• Resolved webdesignerwp

    (@webdesignerwp)


    Hi, I’m attempting to add the blog page into the breadcrumb on a category page:
    Home | News | Category

    Here’s the code I’ve added:

    // Edit NEWS breadcrumbs
    add_filter( 'wpseo_breadcrumb_links', 'yoast_seo_breadcrumb_append_link' );
    function yoast_seo_breadcrumb_append_link( $links ) {
        global $post;
        if ( is_category ) {
            $breadcrumb[] = array(
                'url' => site_url( ‘/news/‘ ),
                'text' => News,
            );
            array_splice( $links, 1, -2, $breadcrumb );
        }
        return $links;
    }

    Two problems:
    1. On the blog page https://ncdprd.wpengine.com/news/
    I now have News | News
    2. On a category page https://ncdprd.wpengine.com/category/acquisitions/
    I have news, but it links to / rather than /news

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello Webdesignerwp

    Thanks for reaching out regarding your breadcrumbs. Unfortunately, we are unable to review your code snippet. There’s a difference between the support we can offer and the level of programming needed to change (core) features of our plugin. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. And though we cannot be of any assistance, you’re completely free to change anything in the plugin to better suit your needs.

    Thread Starter webdesignerwp

    (@webdesignerwp)

    Good Morning Maybellyne,

    Can you please offer a generic solution of how to add the blog page to the breadcrumb on a category archive?

    Thank you.

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi,

    We’re sorry if we’re unable to provide some exact sample code on how to use that filter to modify the breadcrumb pathway for your specific use-case. You may want to look at some examples here, otherwise, we’ll leave this forum thread open for a few days for suggestions and advice from other users.

    Thread Starter webdesignerwp

    (@webdesignerwp)

    Hi Michael Tina, should these settings enable the blog page to show in the breadcrumb on a category page without additional code?

    1. SEO –> Search Appearance — Show Blog Page –> On
    2. Settings –> Reading –> Posts Page –> (select page)

    The breadcrumb is being displayed via a shortcode
    [wpseo_breadcrumb]

    Thank you

    Suwash

    (@suascat_wp)

    @webdesignerwp

    With that setup, we expect Blog in breadcrumb will appear when you view the post, however, we doubt (or would not show) when you view or you are on the category page.

    Jeroen Rotty

    (@jeroenrotty)

    Hi all,

    This thread has been marked as resolved due to the lack of activity by the original poster.

    If you are not the original poster but have a similar issue, please open a new request.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add Blog Page to Category Breadcrumb’ is closed to new replies.