-
AuthorPosts
-
April 20, 2017 at 8:50 pm #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 ArticleBest Regards
I Hope in a Prompt Reply
Thanks- This topic was modified 7 years, 7 months ago by Marco.
April 26, 2017 at 7:32 am #783283Hey sacha,
Can you please send us a link to the pages in question so we can take a closer look?
Best regards,
SarahApril 26, 2017 at 8:01 am #783301centainly Thanks
for exemple, in this ( portfolio Category ) I would like to show the breadcrump: Home >> Escort Livorno >> Annunci escort Cecina >> Cecina Mare >> ArticleApril 26, 2017 at 8:02 am #783302centainly Thanks
for exemple, in this ( portfolio Category ) I would like to show the breadcrump: Home >> Escort Livorno >> Annunci escort Cecina >> Cecina Mare >> ArticleApril 30, 2017 at 5:38 am #785183Hi,
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,
IsmaelApril 30, 2017 at 12:51 pm #785228Hi 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?May 1, 2017 at 8:06 am #785573Hi!
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,
IsmaelMay 1, 2017 at 11:06 am #785629OH IT IS PERFECT ! JUST WHAT I WANT …MANY THANKS ISMAEL…
HAVE A BEAUTYFOUL DAY!May 1, 2017 at 3:01 pm #785761Hi,
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,
RikardMay 22, 2017 at 4:39 pm #797758Hello,
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 > ArticleFor 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
May 25, 2017 at 3:07 am #799314Hi,
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 -
AuthorPosts
- You must be logged in to reply to this topic.