刚刚从genesis breadcrumbs类文件(/lib/classes/breadcrumb.php)中的get\\u cpt\\u crumb()函数中抓取了一个片段
protected function get_cpt_crumb() {
$post_type = get_query_var( \'post_type\' );
$post_type_object = get_post_type_object( $post_type );
if ( $cpt_archive_link = get_post_type_archive_link( $post_type ) )
$crumb = $this->get_breadcrumb_link( $cpt_archive_link, sprintf( __( \'View all %s\', \'genesis\' ), $post_type_object->labels->name ), $post_type_object->labels->name );
else
$crumb = $post_type_object->labels->name;
$crumb .= $this->args[\'sep\'] . single_post_title( \'\', false );
return $crumb;
}
我只是把面包屑放在只抓取标题而不是档案上。
function eco_crumb_filter( $crumb, $args ) {
if ( is_singular( \'team\' ) )
return single_post_title( \'\', false );
else
return $crumb;
}
add_filter( \'genesis_single_crumb\', \'eco_crumb_filter\', 10, 2 );