How to properly use a hook to create template for custom product type in a plugin such as Woocommerce? [closed]

You may use an action in the format woocommerce_YOUR_PRODUCT_TYPE_add_to_cart to reach the goal. Here is the example. The following code is for putting in functions.php, if you are writing a plugin. Please remember to change the callback. eg. you have a product type called Special, you want to add the add-to-cart template for it. add … Read more

Make the css of the widget overwrite theme css

Is possible to make bootstrap css “contextualized” inside a selector, i.e. bootstrap styles works inside that selector, and thanks to css specificity rules, there them take precence over other rules. How to do: First of all download bootstrap less. Let’s assume that this files are in ‘bootstrap/less’ folder. Now create a new less file, let’s … Read more

Getting rid of unused css directives [closed]

The guys behind this project I trust a lot. https://unused-css.com/ Also I used this long time ago: https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/ However, you need to be careful, because you must not remove some CSS that will be used in the future, or in case some feature is enabled later.

include(locate_template) messing up the loop

I found the problem here. It was with the $this_page variable, it was referencing the homepage still and kept the about page from working. I had to simply modify how it was pulling the page ID and storing it. Here’s my amended code. <?php /* Template Name: Page- Home */ get_header(); ?> <?php $this_page=get_the_ID(); $loop … Read more