Add Blog Page to Category Breadcrumb
-
Hi, I’m attempting to add the blog page into the breadcrumb on a category page:
Home | News | CategoryHere’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 /newsThe page I need help with: [log in to see the link]
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Add Blog Page to Category Breadcrumb’ is closed to new replies.