Tagged: breadcrumbs, mega menu, url
-
AuthorPosts
-
February 18, 2016 at 1:32 pm #585386
Hello
We are having some problems with breadcrumbs in relation to the mega menu. I’ve had a look through the support forum and can’t find a solution, so am hoping you can help.
The structure of our mega menu is as follows:
Top Level Mega Menu, no url link
Column 1, no url link
Page 1 with Link
Page 2 with Link
Column 2, no url link
Page 3 with Link
Page 4 with Link
etc. etc.However, the breadcrumbs that show “you are here: …” all link to urls that should not exist. So for instance, if someone clicks onto Page 4, the breadcrumbs say “You are here: Home > Top Level Mega Menu > Column 2 > Page 4” with links to both ‘Top Level Mega Menu’ and ‘Column 2’.
Is there a way to stop this happening?
I’ve included a link to our site in Private content.
Your help is greatly appreciated
Many thanksFebruary 19, 2016 at 5:22 pm #586178Hi Guys,
Would we able to get an answer on this today? This project is time sensitive as site goes live soon.
Thanks for your help.
February 22, 2016 at 9:32 am #586982Hi!
Thank you for using Enfold.
First, let me clarify that the breadcrumbs and menu items have no connection to each other, script-wise. If you don’t want the pages to show in the breadcrumbs, unset it as parent page. Or add this in the functions.php file:
add_filter('avia_breadcrumbs_trail', 'avia_change_breadcrumb', 5, 1); function avia_change_breadcrumb($trail) { global $post; $home = avia_get_option('frontpage'); if(is_page()) { $home = array_shift($trail); $last = array_pop($trail); $trails = $trail; $parents = array(); foreach($trails as $trail => $value) { $href = '/<a(.*?)href="(.*?)"(.*?)>/'; $parents[] = preg_replace($href, '<a href="#" class="no-link">', $value); } array_unshift($parents, $home); array_push($parents, $last); $trail = $parents; } return $trail; }
And the following code in the Quick CSS field:
.no-link { pointer-events: none; }
Cheers!
IsmaelFebruary 22, 2016 at 1:45 pm #587090Hi Ismail
Thanks for what you have written. does it remove all the bread crumbs ? we want to keep some but we dont want a What we do page to exist
thanks
February 22, 2016 at 1:50 pm #587096Hi Ismael
what we really want is a menu heading – What We Do
But we dont want a page called this to exist
Please tell me how i can do this. Thanks for help
February 24, 2016 at 6:07 am #588145Hi!
Did you try the code? It will remove the link of the parent pages but they will still be displayed in the breadcrumb. Don’t forget to add the css code.
what we really want is a menu heading – What We Do
I’m sorry but I don’t understand it clearly. Could you please explain it a little bit further? Or add a screenshot (imgur or dropbox).
Regards,
IsmaelFebruary 25, 2016 at 5:40 pm #589285Hi Ismael
Sorry for late reply
we will come back to you
Thanks
February 27, 2016 at 5:20 am #590130Hi,
Ok, thanks for letting us know. We’ll keep the thread open in case you should need any more help.
Regards,
RikardMarch 1, 2016 at 1:19 am #591272Thanks
Ive got round it please consider this closed
Thanks for help
March 2, 2016 at 5:18 am #591872 -
AuthorPosts
- The topic ‘Mega Menu Issue with Breadcrumbs Linking to Pages that Shouldn't exist’ is closed to new replies.