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

    (@mikejolley)

    Thread Starter wp_fish

    (@wp_fish)

    That’s helpful but I need a little more, I can see these are responsible for outputting individual elements,

    add_action( ‘woocommerce_before_shop_loop_item’, ‘woocommerce_template_loop_product_link_open’, 10 );
    add_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_product_link_close’, 5 );
    add_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10 );
    add_action( ‘woocommerce_before_shop_loop_item_title’, ‘woocommerce_template_loop_product_thumbnail’, 10 );
    add_action( ‘woocommerce_shop_loop_item_title’, ‘woocommerce_template_loop_product_title’, 10 );
    add_action( ‘woocommerce_before_subcategory’, ‘woocommerce_template_loop_category_link_open’, 10 );
    add_action( ‘woocommerce_shop_loop_subcategory_title’, ‘woocommerce_template_loop_category_title’, 10 );
    add_action( ‘woocommerce_after_subcategory’, ‘woocommerce_template_loop_category_link_close’, 10 );
    add_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 );
    add_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_rating’, 5 );

    But, I don’t want them all wrapped in the same anchor tag.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    So you can use remove action on:

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

    to remove the link.

    Thread Starter wp_fish

    (@wp_fish)

    add_action( ‘woocommerce_before_shop_loop_item’, function(){ echo(”); }, 10 );

    add_action( ‘woocommerce_after_shop_loop_item’, function(){ echo(”); }, 5 );

    The above, I was expecting, should of got rid of the wrapping anchor tags but it doesn’t. I’ve put that in my theme’s function file.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Thread Starter wp_fish

    (@wp_fish)

    Yeah I worked it out eventually. I am getting to grips with how it works now. Thanks for the help ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change markup in products list page’ is closed to new replies.