Can’t get the first picture in the last post (function – get_first_post_image). Where is the mistake? Please help me. Thank you in advance for your help. Sorry for my bad English. Answer I’ve rewritten the function to return the default image if no first image is found. Best way of parsing H…
Tag: wordpress
How to get custom fields values from WooCommerce orders
I have checked similar questions but couldn’t resolve the problem. This is my code so far: It is giving me this error: “billing_vergi_dairesi was called incorrectly. Order properties should not be accessed directly”. So I replaced $order->billing_vergi_dairesi; and $order->billing_verg…
Automate a weekly background function in WordPress
I’m developing a WordPress site for a client who is listing celebrities on her site. Each celebrity profile shows a table of social media stats which is grabbed via the relevant API using the respective user handle. For example the Twitter follower count is retrieved via the Twitter API. Everything work…
How to decrease file size upload for non-admin users?
My site allows upload file size of up to 256 MB but I would like to limit my site users to only 1 MB max and keep the maximum 256 MB for the admins. All solutions I found only show how to increase the upload limit, but not decrease for specific roles. I tried the following but it didn’t work:
How do i add multiple classes to the_post_pagination array?
If i try to add multiple classes into the the_post_pagination array class string with a space between the words it will stick them together when the code is executed. Is there a way to do this …
Product variation and parent variable product objects in WooCommerce hook
I developed a custom delivery time info for variations. But for some reason, I can’t get the parent product id of the variation to use it in my function. I tried the following – if I set $id straight …
Using WordPress Featured Image as CSS Background Image
I’m trying to use the latest post featured image as a background image for a div on my homepage. Can anyone help with the php? Answer wp_get_recent_posts() will return a single, most recently published post using the parameters below. I recommend placing the style in a stylesheet.
Remove specific product variation from cart in WooCommerce
I want to remove a variation product from the cart in wordpress, woocommerce. I’m able to remove a simple product but not a variation product. With this code I can remove a simple product. I have tried passing in both the variation id and the parent variation id. I have no idea why its not working, woul…
PHP get_headers function always HTTP/1.1
The PHP get_headers function returns an array, eventually including a string like HTTP/1.1 200 OK. The URLs I pass to the function are https. For some reason the successful response of get_headers always has HTTP/1.1, but Firefox devtools – network tab says it’s HTTP/2. I call the function like $h…
Show estimated dispatch date after add to cart form in product page
I have a Woocommerce store and I would like to show my customers an estimated dispatch date below the add to cart form. The logic is If the customer places the order by 12PM IST, it would be dispatched by 3-5 Working Days. If the customer places the order after 12PM IST, it would be dispatched by 4-5 Working …