Last active
March 7, 2018 18:54
-
-
Save ryantownley/de24f4b4a2d06632d8976db354a88e74 to your computer and use it in GitHub Desktop.
Add breadcrumbs to Genesis Portfolio Pro archives and single pages
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 | |
//* Do NOT include the opening php tag | |
//* Add the breadcrumb navigation to portfolio archives and single pages | |
add_action( 'genesis_before_loop', 'add_portfolio_breadcrumb' ); | |
function add_portfolio_breadcrumb() { | |
if ( get_post_type( $post_id ) == 'portfolio' || is_post_type_archive( 'portfolio' ) || is_tax( 'portfolio-type' ) ) { | |
add_action( 'genesis_before_loop', 'genesis_do_breadcrumbs', 15 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ryan,
Thanks for posting this. Is sounds like what I'm looking for. A breadcrumb so that users can click back easily, as the Portfolio plugin doesn't keep the Nav item highlighted when in a portfolio item page.
I tried pasting this at the top of the functions.php file, but when I saved and reloaded the page, it just posted the code to the top of all the pages on the site.
Can you tell me where the code goes?
thanks