Community Forums › Forums › Archived Forums › Design Tips and Tricks › Woocommerce Duplicate Product Archive Heading
Tagged: Gallery Pro, product category, WooCommerce
- This topic has 4 replies, 2 voices, and was last updated 8 years, 8 months ago by
BrendaGaelSmith.
-
AuthorPosts
-
April 25, 2017 at 4:05 am #205244
BrendaGaelSmith
ParticipantI am using the Gallery Pro theme with Woocommerce with the Genesis Connect for WooCommerce plugin. When I go to the product by category archive page, I get duplicate heading as follows:
<main id="genesis-content" class="content">
<div class="archive-description taxonomy-archive-description taxonomy-description">
<h1 class="archive-title">Book</h1>
</div>
<h1 class="page-title">Book</h1>
<p class="woocommerce-result-count"> Showing the single result</p>
<ul class="products">
</main>What is the best way of removing this duplicate heading?
April 25, 2017 at 6:44 am #205251Victor Font
ModeratorThe text may be duplicated, but they aren't actually duplicate elements. One is the archive title, the other is the page title. You can use the following to remove page titles:
add_action( 'get_header', 'child_remove_page_titles' ); function child_remove_page_titles() { $pages = array('1', '2'); if ( is_page( $pages ) ) { remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); } }Change the numbers in the array to the IDs of the pages from which you want the titles removed.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?April 25, 2017 at 6:08 pm #205307BrendaGaelSmith
ParticipantThank you for your reply Victor. I assume that I add this code to the functions.php folder for my theme? If so, that isn't working for me. See eg: https://deborahlouie.com.au/shop/
Not that I actually want to remove/hide the shop page title but I tested it with the page ID 76.Anyway, your comment highlights that two separate elements are appearing and gives me a heads up for where I might look for other solutions.
My other challenge is trying to work out the relevant ID for the archive page. The product ID for books is 17 but I don't know how this works with this product listing by category page. See: https://deborahlouie.com.au/product-category/book/
Any guidance is welcome.
April 26, 2017 at 6:52 am #205340Victor Font
ModeratorInstall the reveal IDs plugin.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?April 30, 2017 at 4:55 pm #205669BrendaGaelSmith
ParticipantHi Victor - I never could get that code to work with Woocommerce archive pages but I found the fix. In the end, it was very easy.
Dashboard>Products>Categories>Select Category>Edit and about half way down the page are the Category Archive Settings where you can change the Archive headline. If you leave it blank, the archive-title element defaults to the same as the category and shows up as a double up.
-
AuthorPosts
- The topic ‘Woocommerce Duplicate Product Archive Heading’ is closed to new replies.