Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #201633

    Hello,
    i have an issue with breadcrumb on post,
    they do not work on some topic; but not all

    i used WP3.8 and latest Enfold version

    #201797

    Hey cyrtocara!

    Do you have any plugins installed? Can you please elaborate the issue? A link to the post with incorrect breadcrumb will help.

    Best regards,
    Ismael

    #201918
    This reply has been marked as private.
    #202519

    Hi!

    Please create me an admin account and post the login data as private reply – I’ll look into it.

    Cheers!
    Peter

    #202590
    This reply has been marked as private.
    #202592
    This reply has been marked as private.
    #203208
    This reply has been marked as private.
    #203529

    Hi!

    I made a syntax mistake while I tested my code. Please upload the original enfold/functions.php file to restore your website. Then insert following code at the end of the functions.php file to add the category to the breadcrumb.

    
    if(!function_exists('avia_modify_single_post_breadcrumb'))
    {
        function avia_modify_single_post_breadcrumb($trail)
        {
    	if(!is_single()) return $trail;
    	$category = get_the_category(get_the_ID());
    	if(empty($category)) return $trail;
    	
    	$newtrail = array();
    
            foreach($category as $cat)
            {
                    if(empty($cat->parent))
                    {
    			$category_link = get_category_link($cat->term_id);
    			$newtrail[] = '<a href="'.esc_url( $category_link ).'" title="'.$cat->cat_name.'">'.$cat->cat_name.'</a>';
                    }
            }
    	
    	if(empty($newtrail)) return $trail;
    	array_unshift($newtrail, $trail[0]);
    	$newtrail['trail_end'] = $trail['trail_end'];
            return $newtrail;
        }
    
        add_filter('avia_breadcrumbs_trail','avia_modify_single_post_breadcrumb');
    }
    

    Btw – this is not a bug of the theme but a design decision. Kriesi normally shows the blog page link in the breadcrumb and not a category link. It seems like you didn’t select a blog page (Enfold > Theme Options) and thus the blog page also won’t show up in the breadcrumb. The code I give you now will replace the default breadcrumb with a category based breadcrumb.

    Best regards,
    Peter

    #203538
    This reply has been marked as private.
    #203542

    Hi!

    I changed the code and it should work now. I altered the function name and thus the filter function callback didn’t work.

    Regards,
    Peter

    #203555

    Works perfectly now,

    Regards,
    Emmanuel

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Breadcrumb problem’ is closed to new replies.