• I would like to know how to add link or button to products category below category thumbnail on shop page. I found content-product_cat.php not sure how to add this simple link or if I am in the correct area in wordpress?
    Any help would be gr8!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Lisa

    (@workingwebsites)

    In general:
    You would create a ‘child’ content-product_cat.php in your theme, then make the changes to that file.

    That means your changes won’t be over-written by Woocommerce updates. It’s also a good idea to use this in a child theme so your theme updates don’t override your work.

    Specifically per Woocommerce:

    1. Create a subdirectory called /woocommerce to your theme directory
    2. Copy all template files you wish to edit into that directory
    3. Keep the same file and directory structure, but do not include the /templates/ subdirectory

    Note that if you update your theme, these files will likely disappear, so it is advisable to work with a child theme

    See:
    https://docs.woothemes.com/document/template-structure/

    Thread Starter scoobydino

    (@scoobydino)

    Thanks Lisa, i did get that far in creating the content-product_cat.php in child-theme but all i want to now is create a link underneath the product category thumbnail that say”view more” and that will have the same function as if you were to click on the thumbnail image. ANY ideas how to do this??

    Lisa

    (@workingwebsites)

    We’re on the right track with the content-product_cat.php file.
    The trick is where to put the link.

    Around line 50 of the original file content-product_cat.php, you’ll see something like:

    /**
    * woocommerce_before_subcategory_title hook.
    *
    * @hooked woocommerce_subcategory_thumbnail – 10
    */
    do_action( ‘woocommerce_before_subcategory_title’, $category );

    This is what happens before the title comes in.
    If you add you link just after the ‘do_action’ you should see it on the page.

    Try:

    /**
    * woocommerce_before_subcategory_title hook.
    *
    * @hooked woocommerce_subcategory_thumbnail – 10
    */
    do_action( ‘woocommerce_before_subcategory_title’, $category );
    echo ‘<div>See More</div>’;

    Note: You don’t need a link because the whole
    <li> tag the category is in, is a link. The link applies automatically.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add link to products link button below category on shop page’ is closed to new replies.