Php link anchor (woocommerce)
-
Hello,
To improve my Woocommerce store under wordpress, I had the archive-product.php theme file modified, like this:
<?php if ( have_posts() ) : ?>
<br><br>
<h2 class=”titlecategoryspecial”>MY TITLE</h2>
<p class=”paracategoryspecial”>MY DESCRIPTION</p><?php echo do_shortcode(“[product_category category=’name-of-my-category’ per_page=’24’ columns=’3′ orderby=’menu_order’]”); ?>
This allows me a better display on my shop page, divided into several personalized blocks according to my different categories, all on the same page.
By doing this, I also pass the woocommerce display, and I can no longer point to a particular category with a widget or the classic menu links. They all take me back to the store page.
So I’m looking to integrate an html link anchor on each H2 title by product category and in a particular location on the page (bottom, middle, top).
I added the classic id = “”.
<?php if ( have_posts() ) : ?>
<br><br>
<h2 id=”nameofthelink” class=”titlecategoryspecial”>MY TITLE</h2>
<p class=”paracategoryspecial”>MY DESCRIPTION</p><?php echo do_shortcode(“[product_category category=’name-of-my-category’ per_page=’24’ columns=’3′ orderby=’menu_order’]”); ?>
Unfortunately, it didn’t work: https://www.mywebsite.com/shop/#nameofthelink
When I point my html link #nameofthelink I stupidly land on my shop page.Someone would have any idea ?
Thank you in advance,
Best regards,
The topic ‘Php link anchor (woocommerce)’ is closed to new replies.