Last active
January 4, 2023 17:37
-
-
Save thecodepoetry/69c2133b4ee671edea1f to your computer and use it in GitHub Desktop.
Change portfolio breadcrumb archive link to your custom portfolio page
This file contains hidden or 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
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; | |
} | |
} |
Doesn't work so far.
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
Add this code snippet in your child theme functions.php and replace the page id with your custom portfolio page id.