Created
December 6, 2022 17:20
-
-
Save kankadev/86f49249ac942540e3fd0544396a4124 to your computer and use it in GitHub Desktop.
[Yoast SEO Breadcrumb Filter] How to filter single breadcrumbs and style "Home" link #yoast #yoastseo #breadcrumb #wordpress #wp
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
#region Yoast SEO Breadcrumb Filter | |
function wpseo_remove_breadcrumb_link($link_output, $link) | |
{ | |
$text_to_remove = 'Startseite'; | |
if ($link['text'] == $text_to_remove) { | |
$link_output = '<a class="knk_breadcrumb_home" href="' . get_home_url() . '"></a>'; | |
} | |
return $link_output; | |
} | |
add_filter('wpseo_breadcrumb_single_link', 'wpseo_remove_breadcrumb_link', 10, 2); | |
#endregion Yoast SEO Breadcrumb Filter |
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
/* #region Breadcrumb */ | |
.knk_breadcrumb_home { | |
&::before { | |
font-family: 'ETModules'; | |
content: "\e009"; /* Home Icon */ | |
} | |
} | |
/* #endregion Breadcrumb*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment