[ad_1]
add_filter( 'wpseo_breadcrumb_links', 'yoast_seo_breadcrumb_append_link' );
function yoast_seo_breadcrumb_append_link( $links ) {
global $post;
if ( is_singular ('post')|| is_post_type_archive( 'post' ) ) {
$breadcrumb[] = array(
'url' => site_url( '/resources/' ),
'text' => 'All Resources',
);
array_splice( $links, 1, -2, $breadcrumb );
}
return $links;Hi, I am trying to add a link to breadcrumbs on posts and post archives only. I have a custom post type that I want to have different links on, so I cannot use is_archive( )
I cannot get is_post_archive to work. can anyone help with ideas on how to fix?
I found this old thread, but I don’t; have the skills to implement or understand how they got the workaround to work.
Any help appreciated!
Thanks,
