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

    Hello, I have a problem with order of Breadcrumbs.
    in Enfold I use some single pages where display a gallery with portfolio articles – each portfolio article are associated in theyr own portfolio category – each Portfolio categories is join with theyr own “mother” portfolio category.
    First of all i wish to affiliate the first Portfolio Category at the page selected. in order to obtain this breadcrumbs :

    HOME >> PAGE >> Portfolio Category level 1 >> Portfolio Category Level 2 >> Portfolio Category Level 3 >> Portfolio Category Level 4 >> Portfolio Article.

    or alterntively could be well :
    HOME >> Portfolio Category level 1 >> Portfolio Category Level 2 >> Portfolio Category Level 3 >> Portfolio Category Level 4 >> Portfolio Article.

    Unfortunately now My Enfold Theme Show Only this :
    Home >> WRONG page >> Portfolio Category Level 4 ( or the last level ) >> Portfolio Article

    Best Regards
    I Hope in a Prompt Reply
    Thanks

    • This topic was modified 7 years, 7 months ago by Marco.
    #783283

    Hey sacha,

    Can you please send us a link to the pages in question so we can take a closer look?

    Best regards,
    Sarah

    #783301

    centainly Thanks
    for exemple, in this ( portfolio Category ) I would like to show the breadcrump: Home >> Escort Livorno >> Annunci escort Cecina >> Cecina Mare >> Article

    #783302

    centainly Thanks
    for exemple, in this ( portfolio Category ) I would like to show the breadcrump: Home >> Escort Livorno >> Annunci escort Cecina >> Cecina Mare >> Article

    https://www.hotescortlivorno.com/escort/escort-cecina-mare/

    #785183

    Hi,

    Thank you for the info.

    Please add this code in the functions.php file.

    add_filter('avia_breadcrumbs_trail', 'avia_change_breadcrumb', 100, 1);
    function avia_change_breadcrumb($trail) {
        if(is_singular('portfolio'))
        {
            global $post;
    
            $home = avia_get_option('frontpage');
            $terms = get_the_terms( $post->ID, 'portfolio_entries' );
    	$text = "";
    
            if(!empty($terms))
            {
                $home = $trail[0];
                $last = array_pop($trail);
    	    $counter = 1;
                foreach($terms as $key => $data)
                {
                    $link = '<a href="'.get_term_link($data).'">'.ucfirst($data->name).'</a>';
                    $link = preg_replace('!rel=".+?"|rel=\'.+?\'|!',"", $link);
                    $link = str_replace('<a ', '<a rel="v:url" property="v:title" ', $link);
                    $text = '<span typeof="v:Breadcrumb">'.$link.'</span>';
    		$trail[$counter] = $text;
    		$counter++;
                }
    	    $trail[0] = $home;
    	    $trail['trail_end'] = $last;
            }
        }
        return $trail;
    }
    

    NOTE: Copy the code directly from this forum, not from your email.

    Best regards,
    Ismael

    #785228

    Hi Ismael, Many Thanks For your Kindness,
    I have already add the filter, But the problem is not solve.. the breadcrumbs Does not mirror the relationships from the portfolio category;
    for exemple
    the portfolio category ” piombino ” is son of the portfolio category ” Livorno ” but appears the wrong p.category “incontri Pisa “:
    and the p.category “vada mazzanta ” is not son of “piombino” but is son of “Rosignano”
    now the breadcrumbs shows bad
    Sei in:Home/PIOMBINO/VADA MAZZANTA/ Vada Mazzanta : Naty
    the whrigth way could be : Sei in:Home/LIVORNO/ROSIGNANO/VADA MAZZANTA/Vada Mazzanta : Naty
    what I have to do ?
    do toy want the password in order to sign in my back and?

    #785573

    Hi!

    I’m sorry but this is the only way that we could display the categories. Another workaround is to remove the default trail. Remove the function above then replace it with the following.

    add_action('after_setup_theme','avia_remove_portfolio_breadcrumb');
    function avia_remove_portfolio_breadcrumb(){
    	remove_filter('avia_breadcrumbs_trail','avia_modify_breadcrumb');
    }

    Regards,
    Ismael

    #785629

    OH IT IS PERFECT ! JUST WHAT I WANT …MANY THANKS ISMAEL…
    HAVE A BEAUTYFOUL DAY!

    #785761

    Hi,

    Great, glad we could help :-)

    Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #797758

    Hello,
    Hi have the same need than Sachasilvestri. I would like to get on my breadcrumb the following scheme : Home > Category Level 1 > Category Level 2 > Category Level 3 > Article

    For the moment, I’ve just created the blog and am finishing the configuration of my blog. So I only have one fictive article.

    Here is the example I have right now :

    The breadcrumb of this article should be : Accueil > Guide des vins > Vins de Bordeaux > Classement des vins de Bordeaux

    Indeed, it is linked to the following categories : “guide des vins” and “vins de bordeaux”, and “vins de bordeaux” is a child category of “guide des vins”.

    Thanks in advance for your help

    Barthélémy

    #799314

    Hi,

    Please add the following filter in the functions.php file.

    add_filter('avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 5, 1);
    function avia_breadcrumbs_trail_mod($trail) {
        if(is_single())
        {
            global $post;
    
            $category = get_the_category($post->ID);
    
            if(!empty($category))
            {
                $home = $trail[0];
                $last = array_pop($trail);
                $trail = array(0 => $home);
    
                foreach($category as $key => $data)
                {
                    $link = '<a href="'.get_category_link($data).'">'.$data->name.'</a>';
                    $link = preg_replace('!rel=".+?"|rel=\'.+?\'|!',"", $link);
                    $link = str_replace('<a ', '<a rel="v:url" property="v:title" ', $link);
                    $link = '<span typeof="v:Breadcrumb">'.$link.'</span>';
                    $trail[] = $link;
                }
    
                $trail[] = $last;
            }
        }
        return $trail;
    }

    It will display the categories assigned to the post.

    Best regards,
    Ismael

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.