WooCommerce breadcrumb and page title disparity

Home Forums Jevelin Theme WooCommerce breadcrumb and page title disparity

Home Forums Jevelin Theme WooCommerce breadcrumb and page title disparity

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    RESOLVED Posts
  • 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

    Attachments:
    You must be logged in to view attached files.

    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

    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

    Attachments:
    You must be logged in to view attached files.

    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 🙂

Viewing 8 posts - 1 through 8 (of 8 total)