How to customize woocommerce related products? [closed]

Firstly, you can’t immediately achieve the goal you described with the code you show in your question. To understand why there isn’t a direct approach with that code you have to take a look at what you’re using – woocommerce_related_products() – to do what you have done so far. Secondly, you have to understand, because … Read more

Theme Activate Hook

I have that code here just name the file theme_activation_hook.php like on the website and copy this. <?php /** * Provides activation/deactivation hook for wordpress theme. * * @author Krishna Kant Sharma (http://www.krishnakantsharma.com) * * Usage: * ———————————————- * Include this file in your theme code. * ———————————————- * function my_theme_activate() { * // code … Read more

Why do some hooks not work inside class context?

Sometimes certain hooks need to be fired at certain times. Example, some hooks need to be fired upon init. Add this to your __construct() add_action(‘init’, array(&$this, ‘init’)); Then add this function, which will contain all hooks that need to be fired upon init. public function init(){ add_action(‘hook_name’, array(&$this, ‘your_method_name’)); add_action(‘hook_name’, array(&$this, ‘your_method_name’)); add_action(‘hook_name’, array(&$this, ‘your_method_name’)); … Read more

Registering Class methods as hook callbacks

If I need to register an action inside the class itself would it work with array($this, ‘bar’)? Yes, it works. $thisDocs is referring to the concrete instance needed for the callback. That’s exactly like the $foo example you give. It’s just that $this is bit more special, but it represents basically the same and it … Read more

WooCommerce: change display order of product short description and price [closed]

If you look at woocommerce/templates/content-single-product.php you’ll see that the product summary is constructed using hooks with different priorities. Here’s the relevant section: <?php /** * woocommerce_single_product_summary hook * * @hooked woocommerce_template_single_title – 5 * @hooked woocommerce_template_single_rating – 10 * @hooked woocommerce_template_single_price – 10 * @hooked woocommerce_template_single_excerpt – 20 * @hooked woocommerce_template_single_add_to_cart – 30 * @hooked … Read more

WP Cron Doesn’t Execute When Time Elapses

First can you please confirm that you don’t have any caching plugins enabled? Caching plugins can interfere with cron jobs because your visitors are not served a live page but a cached version of your page. If you have a caching plugin enabled, you can choose one of your pages, add an exclussion to your … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)