Last active
June 20, 2025 09:59
-
-
Save propertyhive/8b16a992bcb5381286d5ce55bd74de48 to your computer and use it in GitHub Desktop.
Overwrite taxonomies links in AIOSEO breadcrumbs
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( 'aioseo_breadcrumbs_trail', 'steves_breadcrumb_change' ); | |
function steves_breadcrumb_change($breadcrumbs) | |
{ | |
$new_breadcrumbs = array(); | |
foreach ( $breadcrumbs as $breadcrumb ) | |
{ | |
if ( isset($breadcrumb['type']) && $breadcrumb['type'] == 'taxonomy' ) | |
{ | |
if ( $breadcrumb['label'] == 'To Let' || $breadcrumb['label'] == 'Let Agreed' || $breadcrumb['label'] == 'Let' ) | |
{ | |
// Any lettings statuses | |
$breadcrumb['link'] = '/lettings/'; | |
} | |
else | |
{ | |
// Any sales statuses | |
$breadcrumb['link'] = '/sales/'; | |
} | |
$new_breadcrumbs[] = $breadcrumb; | |
} | |
else | |
{ | |
$new_breadcrumbs[] = $breadcrumb; | |
} | |
} | |
return $new_breadcrumbs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment