Skip to content

Instantly share code, notes, and snippets.

@setola
Created June 6, 2012 23:32
Show Gist options
  • Save setola/2885504 to your computer and use it in GitHub Desktop.
Save setola/2885504 to your computer and use it in GitHub Desktop.
Trick to have the 'Portfolio' entry into the breadcrumbs
<?php
/**
* Trick to have the 'Portfolio' entry into the breadcrumbs
*/
global $portfolio_id;
$portfolio_id = 165;
add_filter('wp_seo_get_bc_ancestors', 'add_portfolio_taxonomy', 10, 1);
function add_portfolio_taxonomy($ancestors){
global $portfolio_id;
$ancestors[] = $portfolio_id;
return $ancestors;
}
global $wp_query, $post;
the_post();
$post->post_parent = $portfolio_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment