Skip to content

Tag: wordpress

How to exclude a specific category from blog posts

How to exclude a specific category from blog posts in WordPress but if a blog post has two categories selected, one from excluded category and the other from included I would like to show the blog post. I tried using this function in function.php, it hides the excluded category but when two categories are sel…

Modify empty keys in associative array in php

i have a really long form in wordpress that it filled out by the user and then submitted to a thirdparty crm via API. The thing is if user doesn’t fill a field, these field will be false or empty and remote_post will fail. I tried to add a custom value to empty fields with a foreach but they are

WooCommerce changing order line totals

I have a plugin which applies discounts based on the category of the product. I’m using the filters below to add text to the order table in the cart: And this action to change the total price of the order/cart. The total price of the order pulls through to the checkout, as do the modified product fields…