Home › Forums › Jevelin Theme › WooCommerce breadcrumb and page title disparity
Home › Forums › Jevelin Theme › WooCommerce breadcrumb and page title disparity
Hi,
I’m trying to set up a WooCommerce shopfront, but I am encountering an issue with the page title and breadcrumb.
As you can see from the screenshot, the breadcrumb is shown as Home > product, with the page title being Products – <site name>. Is there any way to fix this using the child theme?
Thanks,
Billy
Hi Billy,
I hope you are well today and thank you for your question.
Could you please tell me how you want it to display so that i can help you to achieve it?
Best regards,
Shufflehound team
Hi Shufflehound,
I’d like the breadcrumb and page title to be consistent with the page name <<my company>> Store.
Thanks,
Billy
Solution for this topic
You can change browser shop page title as described in the following pages.
http://www.cpu20.com/2016/change-woocommerce-shop-title-product-archive-to-something-meaningful/
https://kb.yoast.com/kb/how-do-i-change-the-woocommerce-shop-page-title/
You can change breadcrumb title by developing custom code in the child theme shared in the following topic.
https://support.shufflehound.com/forums/topic/titlebar-of-shop-page-product/#post-13547
Hey Shufflehound,
Those links worked perfectly. Took me a bit to find what to change in the custom breadcrumb code, but you change this line (for any users who have the same problem):
$html .= '<span class="item-current item-archive"><span class="bread-current bread-archive">' . __( 'Produktai', 'jevelin' ) . '</span></span>';
Change ‘Produktai’ to whatever you want your store name to display as in your breadcrumb.
I now have another issue that’s related (shown in attachments). My store displays the breadcrumb correctly, but products will display the wrong parent breadcrumb. Clicking the “incorrect” breadcrumb will still take you back to the store with the correct name.
Anything I might need to change in that custom breadcrumb function?
Thanks,
Billy
Solution for this topic
I now have another issue that’s related (shown in attachments). My store displays the breadcrumb correctly, but products will display the wrong parent breadcrumb. Clicking the “incorrect” breadcrumb will still take you back to the store with the correct name.
Anything I might need to change in that custom breadcrumb function?
You can achieve that by adding below code in the functions.php file of your child theme.
function vvd_change_post_labels($post_type, $args){ /* change assigned labels */ global $wp_post_types; if($post_type != 'product') return; $wp_post_types[$post_type]->labels->name = __( 'Shop', 'woocommerce'); } add_action('registered_post_type', 'vvd_change_post_labels', 2, 2);
Thanks Shufflehound. You guys are the best.
For those who might come across the same problem, change this line in the above code:
$wp_post_types[$post_type]->labels->name = __( '<Your shop name here>', 'woocommerce');
You are most welcome here 🙂