Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1357624

    Hi,
    you can see in private content the URL

    I use a mega menu (menu item “Trauerfall”) and as you can see in the linkin private content i do not have pages on the primary menu (“Trauerfall”) and no pages for the colum titels (“Erste Maßnahmen”) of the mega menu – so far so good, that exactly what i wanted to achieve.
    I am using a breadcrumb to show the user where in this huge amount of future pages he is at the moment. Navigation through the breadcrumb is not (!!) wanted and does not make sense, because there is no content on the pages of the primary menu or the column. But i need to have these “empty pages” to sort them hierarchical and to generate the breadcrumb hierarchy itself.

    My question: is there a way to keep this breadcrumb as it is and just remove the links? Because they lead only to empty pages – except the homepage?
    Thanks a lot, Sven

    #1357636

    well a quick and dirty way is to make them not clickable in quick css:

    .breadcrumb {
      pointer-events: none;
    }

    but in the DOM the a-tags and all href are still present.
    to change all settings in class-breadcrumb-trail.php and class-breadcrumb-legacy.php and have child-theme substitutes is complex and – on parent theme changes in those files you had to think of reproducing that changes.

    a jQuery solution could be to change a-tag to span-tag and remove the hrefs – please try in your child-theme functions.php:

    function breadcrumb_links_to_span(){
    ?>
    <script>
    (function($) {
      $('.breadcrumb-trail span').css('float', 'left');
      $('.breadcrumb ').each( function() {
        $(".breadcrumb-trail a").replaceWith(function(){
          return $("<span>" + $(this).html() + "</span>").removeAttr('href');
        });
      });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'breadcrumb_links_to_span');
    #1357643

    …thanks a lot for your quick response – quick and dirty is working for me :-)

    Regards Sven

    #1357693

    Hi,
    Glad Guenni007 could help, thank you Guenni007, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Breadcrumb >> no links’ is closed to new replies.