I have made a div with a specific class that shows the sale percentage of a product that is on sale. But i want to remove this div when the product is not on sale. I don`t know how to write the php …
Tag: wordpress
Sort results from high to low float array – wordpress
Maybe this should be very easy but I am a bit lost on how to sort this data in a good way. I got this query in a WordPress template to get some post_meta: $args = array( …
Get a custom calculations as WooCommerce admin bulk orders action
i want to make order totals go under a calculation formula. i have drivers whom salary is per order. they deliver paid and unpaid orders. so They collect unpaid cod payments from the customers.At the …
Check if there is 24 hours gone since a Woocommerce order is made
I call a Woocommerce method $order->get_date_created() that is returning this WC_DateTime object: How can I check if there is more (or less) than 24 hours are gone since the order is made? Answer Here is the way to check if there is more (or less) than 24 hours passed since an order has been created, using…
How to generate a pdf on post saving or updating
I’m trying to create a PDF from post content, including some ACF fields. Currently I’ve got it working on a POST form and dynamically creating a PDF each time, but I’d like to make it generate the PDF …
Customize addresses fields on WooCommerce My account and Checkout
I’m using the woocommerce_checkout_fields filter to edit the value of woocommerce field labels. It works fine on the checkout page (as you might expect), however I cannot understand why it doesn’t also take effect on the account pages. I thought these fields were still taken form the same place? M…
How to pass parameters to add_feed in an OOP singleton
I struggle creating separate page feeds (list of URLs) in each language when WPML is active. The plan is to have different feed names for each language, such as feed_name_en or feed_name_fr. I …
weird usage of php open and close tag in callback functions
This is a piece of TwentyTwelve WordPress theme which actually proposed as a good material for learning theme development by WordPress itself. This function is sent as a callback. But the thing is …
WordPress automatically adds and between widgets areas, how to avoid it?
So I have had to edit some code of the template I am using because I need two widget areas in the header, I have managed to achieve it, but the problem comes when WordPress adds
and <p&…
Restrict content to those who purchased a Woocommerce product
I’m trying to restrict content on the page via shortcode for those who purchased a particular woocommerce product. I tried using the code below but it’s not working – shortcode [wcr pid=”78] this is some text [/wcr] is just being outputted on the page without hiding the content. Woocom…