Skip to content

Instantly share code, notes, and snippets.

@ryantownley
Last active March 7, 2018 18:54
Show Gist options
  • Save ryantownley/de24f4b4a2d06632d8976db354a88e74 to your computer and use it in GitHub Desktop.
Save ryantownley/de24f4b4a2d06632d8976db354a88e74 to your computer and use it in GitHub Desktop.
Add breadcrumbs to Genesis Portfolio Pro archives and single pages
<?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 );
}
}
@MemeRunner
Copy link

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

@MemeRunner
Copy link

Here's the link to the portfolio, if that helps
http://dougschumacher.com/portfolio-type/portfolio/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment