wpseo_breadcrumb_links
-
When using this filter it works correctly on every page but the category page. On the Category page it is displaying the media center link and the corporate officer link which should only show up on those page.
add_filter( 'wpseo_breadcrumb_links', 'unbox_yoast_seo_breadcrumb_append_link' ); function unbox_yoast_seo_breadcrumb_append_link( $links ) { global $post; if( is_singular('corporate-officer') || is_archive('corporate-officer')) { $breadcrumbs[] = array( array( 'url' => get_permalink( 805 ), /*Media Center*/ 'text' => get_the_title( 805 ), ), array( 'url' => get_permalink( 1552 ), /*Corporate Officers*/ 'text' => get_the_title( 1552 ), ) ); array_splice( $links, 1, -2, $breadcrumb ); foreach ($breadcrumbs as $breadcrumb) { array_splice( $links, 1, -2, $breadcrumb ); } } return $links; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘wpseo_breadcrumb_links’ is closed to new replies.