Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );

    Add to theme functions.php

    Thread Starter TommyFutemarketing

    (@tommyfutemarketing)

    Hello Mike,

    Thank you for the respond. I created a function.php in my child-theme and I already added this two lines of code but it doesn’t do anything. I can still click and have the link.

    Here is my function.php in child-theme :

    <?php
    function storefront_child_styles_scripts() {
      //Enqueue parent stylesheet
      wp_enqueue_style( 'storefront-style', get_template_directory_uri().'/style.css' );
    
      //enqueue theme css
      wp_enqueue_style( 'storefront-child-style', get_stylesheet_directory_uri().'/style.css' );
    
    }
    
    add_action( 'wp_enqueue_scripts', 'storefront_child_styles_scripts' );
    
    remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );
    
    ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]

    Plugin Contributor James Koster

    (@jameskoster)

    Looks like your theme is already interacting with those elements somewhere. Check to see if it is overriding templates, hopefully there will be some notes in there. Otherwise you’ll need to speak with the author about what you’re trying to do.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to remove the link to single product from image.’ is closed to new replies.