Created
June 6, 2012 23:32
-
-
Save setola/2885504 to your computer and use it in GitHub Desktop.
Trick to have the 'Portfolio' entry into the breadcrumbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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