Portfolio breadcrumb link in the7 always link to the archive page, to change it to your custom portfolio listing page, add this code in your child theme’s funtions.php
add_filter( 'post_type_archive_link', function ( $link, $post_type ) { if($post_type == 'dt_portfolio' ) { $link = get_permalink( 6936 ); //id of the target page } return $link; }, 10, 2 ); }
Please remember to update #6936 to with your target page ID. You can change the breadcrumb link for another post type as well. Just adjust the if condition accordingly.
This really helped me, thank you!!!
I copied your sentence child theme. But it makes WordPress error. TT
any help?
Thank you, this solved my problem!
One comment though: the last closing curly bracket (line 11) is too much. it doesn’t have an opening bracket and therefore will throw an error when being copy pasted. Would be amazing if you could remove it.
That works! Thank you :))