Skip to content

Instantly share code, notes, and snippets.

@jakerb
Created March 28, 2022 10:15
Show Gist options
  • Save jakerb/5d0a552eddf776bd283ad5f4ed7b2f41 to your computer and use it in GitHub Desktop.
Save jakerb/5d0a552eddf776bd283ad5f4ed7b2f41 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'wpseo_breadcrumb_links', 'yoast_seo_breadcrumb_append_link' );
function yoast_seo_breadcrumb_append_link( $links ) {
global $post;
if (get_post_type($post->ID) == 'custom-post-type') {
$links = array(
array('url' => site_url('/'), 'text' => 'Home'),
array('url' => site_url('/team-members'), 'text' => 'Team Members'),
array('url' => get_the_permalink($post->ID), 'text' => $post->post_title)
);
}
return $links;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment