einfach in single.php erstellen:
$postcat = get_the_category( $post->ID );
if ( ! empty( $postcat ) ) {
print "<div>";
print "<span><a href=\"/blog/\">Blog</a></span> >> ";
print "<span><a href=\"/category/".$postcat[0]->slug."/\">".esc_html( $postcat[0]->name )."</a></span> >> ";
print "<span>".get_the_title( $post_id )."</span> ";
//slug oder category_nicename
print "</div>";
}
bzw so

Erweiterete Version mit CSS
<?php
$postcat = get_the_category( $post->ID );
if ( ! empty( $postcat ) ) {
print "<style>";
print "li.bread::after { content: \" / \"; }";
print "</style>";
print "<div>";
print "<ul style=\"list-style-type:none;\">";
print "<li class=\"bread\" style=\"display: inline-block;white-space: nowrap;\"><a href=\"/blog/\">Blog</a></li> ";
print "<li class=\"bread\" style=\"display: inline-block;white-space: nowrap;\"><a href=\"/category/".$postcat[0]->slug."/\">".esc_html( $postcat[0]->name )."</a></li> ";
print "<li style=\"display: inline-block;white-space: nowrap;\">".get_the_title( $post_id )."</li> ";
//slug oder category_nicename
print "</ul>";
print "</div>";
}
?>
oder als strukturierte Daten
print "
<script type=\"application/ld+json\">
{
\"@context\": \"http://schema.org\",
\"@type\": \"BreadcrumbList\",
\"itemListElement\": [
{
\"@type\": \"ListItem\",
\"position\": 1,
\"item\": {
\"@id\": \"https://blog.guentherhaslbeck.de/blog/\",
\"name\": \"Blog\"
}
},{
\"@type\": \"ListItem\",
\"position\": 2,
\"item\": {
\"@id\": \"https://blog.guentherhaslbeck.de/category/".$postcat[0]->slug."/\",
\"name\": \"".esc_html( $postcat[0]->name )."\"
}
},{
\"@type\": \"ListItem\",
\"position\": 3,
\"item\": {
\"@id\": \"".get_permalink($post_id)."\",
\"name\": \"".get_the_title( $post_id )."\"
}
}
]
}
</script>
"
Testen unter https://search.google.com/structured-data/testing-tool?hl=de#
Eine Antwort auf „Eigene Breadcrumb in wordpress“
[…] Eigene Breadcrumb in wordpress […]