Tagged: breadcrumb, double, links
-
AuthorPosts
-
November 22, 2013 at 12:13 pm #191806
I use Woocommerce as shop and have setup a page as shop page – it calls shop. If I call a subpage like product category or a keyword page, I do have in the breadcrumb the top link to page “shop” twice. I am not shure, were it comes from. I setup permalinks like this:
product category base: shop
product keyword base: productkeyword
and under user defined product-permalink base: /shopAll URLs are fine except in the breadcrumbs only I do have this behavior. I checked my wpSEO plugin too, but did not find any reason for this.
Any help welcome.
- This topic was modified 10 years, 12 months ago by adrianwackernah.
November 22, 2013 at 6:52 pm #191983Hey adrianwackernah!
And both ‘shops’ are linking to the same page?
Cheers!
JosueNovember 22, 2013 at 6:55 pm #191988Yes, Josue
November 25, 2013 at 10:34 am #192849Hi!
Please create us an admin account and post the login credentials as private reply – we’ll look into it.
Cheers!
PeterNovember 25, 2013 at 10:50 am #192859This reply has been marked as private.November 26, 2013 at 9:55 am #193315Hey!
I can’t modify the theme files and thus I can’t debug the issue. We need to know how the breadcrumb trail look like. Insert following code into the theme functions.php file
if(!function_exists('avia_modify_event_breadcrumb')) { function avia_modify_event_breadcrumb($trail) { print_r($trail); return $trail; } add_filter('avia_breadcrumbs_trail','avia_modify_event_breadcrumb'); }
and Enfold should output some new text/code at the very top of the page (i.e. here: http://bildmanufaktur-wackernah.de/shop/ebooks/ ). Please copy it and post it in this thread.
Best regards,
PeterNovember 26, 2013 at 10:00 am #193320Hi Peter, I got this returned:
Array ( [0] => Startseite [1] => Shop [trail_end] => eBooks )
November 26, 2013 at 10:06 am #193326Hi Peter, I pasted the code snipped first at very top of the functions.php at line 15. Than I moved the code from very top to near the end of the function.php at line 415 and now I got this output:
Array ( [0] => Startseite [1] => Shop [2] => Shop [3] => eBooks )
November 26, 2013 at 10:08 am #193329Hi!
Ok, now try to insert following code instead
if(!function_exists('avia_modify_event_breadcrumb')) { function avia_modify_event_breadcrumb($trail) { foreach($trail as $key => $data) { if(strpos($data,'href="http://bildmanufaktur-wackernah.de/shop/"') !== false) unset($trail[$key]); } return $trail; } add_filter('avia_breadcrumbs_trail','avia_modify_event_breadcrumb'); }
Does it solve the issue?
Cheers!
PeterNovember 26, 2013 at 10:11 am #193331I pasted it again at line 415 and now the “shop” is completely removed from the breadcrumb.
Sie befinden sich hier:Startseite / eBooks
It is not solved.
November 26, 2013 at 10:12 am #193332Hi!
Yes, I just read your last post – try following code instead
if(!function_exists('avia_modify_event_breadcrumb')) { function avia_modify_event_breadcrumb($trail) { $urls = array(); foreach($trail as $key => $data) { if(in_array($data, $urls)) { unset($trail[$key]); } else { $urls[] = $data; } } return $trail; } add_filter('avia_breadcrumbs_trail','avia_modify_event_breadcrumb'); }
Regards,
PeterNovember 26, 2013 at 10:16 am #193335Yes, it is solved, Peter. Thanks.
But what is the reason for this? Does it affect all users of woocommerce? Do I have to put that code into functions.php after each upgrade of Enfold?
November 26, 2013 at 10:24 am #193340Hey!
You can also put it into your child theme – then you don’t need to modify functions.php every time you update the theme.
But what is the reason for this? Does it affect all users of woocommerce?
No, afaik you’re the first user who reported this issue – that’s why I had to debug the breadcrumb output first. It seems like wordpress adds the same page id (shop page) to your breadcrumb several times but I’m not sure why. Maybe a third party plugin causes the issue or it’s a configuration issue with the WooCommerce shop page but I’m not sure. I’ll monitor the support forum and if more users report the same issue we’ll check the code of our breadcrumb function.Best regards,
PeterNovember 26, 2013 at 10:29 am #193343OK, thats a good idea, trying child themes for the first time for me.
I will look into this over the time if I upgrade Enfold or plugins and if it appears again without that code snippet.
Thanks again and best regards, Adrian
-
AuthorPosts
- The topic ‘Pagelink in Breadcrumb twice’ is closed to new replies.