Hi,
I try to create two blogs on same site.
There are two different blog page.
I didn’t set any page_for_posts,since I have two different pages.,
The post breadcrumb doesn’t include the post page.
How can I get post page in breadcrumb?
Thanks,
Orit
Hi modelity!
Open up functions.php and insert following code at the very bottom of the file
if(!function_exists('avia_modify_blog_breadcrumb'))
{
add_filter('avia_breadcrumbs_trail','avia_modify_blog_breadcrumb');
function avia_modify_blog_breadcrumb($trail)
{
if(get_post_type() === "post" && (is_single() || is_category() || is_archive() || is_tag()))
{
$blogid = 20;
if($blogid)
{
$blog = '<a href="' . get_permalink( $blogid ) . '" title="' . esc_attr( get_the_title( $blogid ) ) . '">' . get_the_title( $blogid ) . '</a>';
array_splice($trail, 1, 0, array($blog));
}
}
return $trail;
}
and replace 20 with the id of your blog page.
Regards,
Peter
Thanks!