- This topic has 8 replies, 2 voices, and was last updated 1 year, 3 months ago by Scott.
-
AuthorPosts
-
May 4, 2020 at 8:15 pm #1269816Chris
Hey guys,
Just installed a takeout menu for a restaurant client to help them get more moneys during the pandemic.
Everything is looking good and your theme plays very nicely with a cool plugin called Woocommerce Product Table to get a nice restaurant-style single page menu.
I have one issue I would like to change:
On the main shop page it is showing the title as “Products” and the original page title that is set in the Pages section has been pushed down into the body of the page.
I would like Products to go away and be replaced by the title that is set. It’s strange, because Products is not listed anywhere on the settings. I feel like it’s buried in Woocommerce somewhere and I don’t know how to turn it off.
Thanks for your help!
ChrisMay 5, 2020 at 2:38 am #1270117DavidStaffCustomer SupportHi there,
Shop pages ( like the Blog and other archives ) don’t have a ‘content title’ like posts and pages do, which is what the Header Elements
{{post_title}}
template tag displays. Instead of displaying nothing GP displays ‘Products’.You will need to exclude the
Product Archive
from your current header element and create another Header Element specifically for the Product Archive and add the title as HTML eg.<h1>My Title</h1>
May 5, 2020 at 5:06 am #1270295ChrisThanks for the response, David.
How does one go about doing that? Will I need to make a new header element that pertains to Woo specific pages? It seems pretty clear that the global header element is not functioning for the shop page, but the order (my name for cart) and checkout pages are working fine.
Will this also fix the issue with the post title being pushed down into the body?
May 5, 2020 at 5:10 am #1270302DavidStaffCustomer SupportEdit your existing Global header element and on the Display Rules > Exclusions – add
Product Archive
.Then create a new Header Element using the same settings as your global one accept the content will be:
<h1>add your title... </h1>
And the display rules > locations will be only
Product Archive
.May 5, 2020 at 6:15 am #1270396ChrisAwesome, all set! Thanks again.
May 5, 2020 at 6:52 am #1270455DavidStaffCustomer SupportYou’re welcome
January 4, 2023 at 10:29 am #2483752ScottSorry for resurrecting an old post, but where are you adding the:
<h1>add your title... </h1>
And just to be clear, when you say add a new header element you’re NOT talking about the hero header right?
January 4, 2023 at 11:21 am #2483815YingStaffCustomer SupportHi Scott,
You can do so with either header element (classic editor) or a block element – page hero (block editor).
January 4, 2023 at 11:47 am #2483841ScottI used to do this with a snippet two years ago. Sadly it’s not working anymore.
function shop_title( $title ) { if ( is_shop() && isset( $title['title'] ) ) { $title['title'] = apply_filters( 'the_title', get_the_title( get_option( 'woocommerce_shop_page_id' ) ) ); } return $title; } add_filter( 'document_title_parts', 'shop_title' );
It’s just an old snippet I saved and haven’t needed it until now … wish it still worked.
-
AuthorPosts
- You must be logged in to reply to this topic.