Skip to content

Instantly share code, notes, and snippets.

@kankadev
Created December 6, 2022 17:20
Show Gist options
  • Save kankadev/86f49249ac942540e3fd0544396a4124 to your computer and use it in GitHub Desktop.
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
#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
/* #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