Adding new divs with custom classes to products on WooCommerce shop page [closed]

Why not edit the template file instead of using hooks? https://github.com/woocommerce/woocommerce/blob/3.8.0/templates/content-product.php This template can be overridden by copying it to yourtheme/woocommerce/content-product.php. A small example <li <?php wc_product_class( ”, $product ); ?>> <div class=”col-md-5 offset-md-1″> <?php /** * Hook: woocommerce_before_shop_loop_item. * * @hooked woocommerce_template_loop_product_link_open – 10 */ do_action( ‘woocommerce_before_shop_loop_item’ ); /** * Hook: woocommerce_before_shop_loop_item_title. * * … Read more

Enqueue script only on child pages of custom post types

Issues The code you shared has some issues: First of all calling a function like this won’t work on the bootstrapping process of the WordPress and can’t get necessary values where and when necessary, so the conditions might not work as you expected. Solution: Hook the function to an appropriate hook, and wp_enqueue_scripts is such … Read more

Google CSE Malfunctions via Chrome/Safari on Mobile When Clicking on Either Search Icon/Menu Icon. How to Make Google CSE Default Theme Search

I found a fix for the issue. On a separate forum, someone said it sounds like the script which is supposed to fire when you click the icon is falling over. That indeed is what it was. A plugin called SG Optimizer added code into my .htaccess file deferring render-blocking JS so I deactivated that … Read more

opens like sitename.com/URL

sgdghd.com is not a complete URL on its own, and if used in a link like <a href=”https://wordpress.stackexchange.com/questions/358412/sgdghd.com”>, it will be treated as a relative URL. To properly link to a different domain, you need to include http:// or https://. To ensure that a value for href is a valid URL, you should use esc_url() … Read more