Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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 thanks

    #586178

    Hi 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.

    #586982

    Hi!

    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!
    Ismael

    #587090

    Hi 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

    #587096

    Hi 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

    #588145

    Hi!

    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,
    Ismael

    #589285

    Hi Ismael

    Sorry for late reply

    we will come back to you

    Thanks

    #590130

    Hi,

    Ok, thanks for letting us know. We’ll keep the thread open in case you should need any more help.

    Regards,
    Rikard

    #591272

    Thanks

    Ive got round it please consider this closed

    Thanks for help

    #591872

    Hi,

    Ok great, glad you got it fixed :-)

    Regards,
    Rikard

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Mega Menu Issue with Breadcrumbs Linking to Pages that Shouldn't exist’ is closed to new replies.