Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #212655

    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

    #212687

    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

    #213845

    Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Breadcrumb issue’ is closed to new replies.