Skip to content

Instantly share code, notes, and snippets.

@thecodepoetry
Last active January 4, 2023 17:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thecodepoetry/69c2133b4ee671edea1f to your computer and use it in GitHub Desktop.
Save thecodepoetry/69c2133b4ee671edea1f to your computer and use it in GitHub Desktop.
Change portfolio breadcrumb archive link to your custom portfolio page
add_filter( 'post_type_archive_link', 'my_portfolio_archive_link', 10, 1 );
function my_portfolio_archive_link( $archivelink ) {
if( get_post_type() == 'dt_portfolio') {
return get_permalink( 382 ); //replace 382 with id of your portfolio page
}
else {
return $archivelink;
}
}
@thecodepoetry
Copy link
Author

thecodepoetry commented Sep 3, 2014

Add this code snippet in your child theme functions.php and replace the page id with your custom portfolio page id.

@hirschferkel
Copy link

Doesn't work so far.

@hirschferkel
Copy link

hirschferkel commented Jan 4, 2023

The breadcrumb link is right, but the name is wrong. E.g.
Start > Project > Raphael 2 column

The name of the Portfolio Page is "Illustrationen" and not "Project"
But the link is .../illustrationen

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