Created
June 12, 2023 16:10
-
-
Save wp-seopress/403c91dc094b61a7a33619967d310f74 to your computer and use it in GitHub Desktop.
Remove last crumb on singular page/post
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
//Remove last crumb on singular page/post | |
add_filter('seopress_pro_breadcrumbs_crumbs', 'sp_pro_breadcrumbs_crumbs'); | |
function sp_pro_breadcrumbs_crumbs($crumbs) { | |
if (is_singular()) { | |
add_filter('seopress_pro_breadcrumbs_last_item_linkable', '__return_true'); | |
end($crumbs); | |
$lastKey = key($crumbs); | |
unset($crumbs[$lastKey]); | |
} | |
return $crumbs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment