How to add breadcrumb to GD-home

This topic contains 8 replies, has 4 voices, and was last updated by  Karin Palle 8 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #250150

    Ray Scarpa
    Expired Member
    Post count: 84

    Hi,

    We do like the breadcrumbs and think users appreciate the ability to navigate from listings back to categories, etc. However we are not using the gd-home page as our site home page, so how can we give users access to navigate back to gd-home (directory home page) in the breadcrumbs?

    Right now they visit http://www.inmaricopa.com/directory/ which is effectively the renamed version of the original gd-home. Selecting categories or individual listings they can see breadcrumbs at top, like “Home > Listings > Health & Wellness > Fitness” but choosing “Home” takes them to site home page. Even showing the “Listings” option in breadcrumbs is kind of confusing, I think, as selecting that brings them back to an “All Listings” page, which isn’t very useful (all listings, no categories). Optimally, it would be nice to have the breadcrumbs say Home > Directory > Health & Wellness > Fitness in the above example, so that users don’t have to manually find their way back.

    Hoping this is possible but would appreciate suggestions if it is not. We can also hide breadcrumbs completely but would prefer to keep them active.

    Thanks!

    #250400

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    neither thing is possible out of the box. The Home link takes to the website home page, which is correct.

    And the listings (cpt) archive is a WordPress default thing.

    I know there are hooks to modify the breadcrumb and I’m almost positive one of the developer already provided an example to modify it, but I can’t find the old topic, so I’ve flagged this for him directly.

    He’ll be back on Monday and he’ll let us know if there is an easy way to do this.

    Thanks for your patience,

    #251020

    Giri
    Expired Member
    Post count: 3155

    You can use this code to change Home breadcrumb item to Directory item.

    But keeping both item not possible at the moment.

    
    
    function modify_breadcrumb_first_item($html) {
        return '<a href="' . home_url() . '/directory/">' . __( 'Directory', 'geodirectory' ) . '</a>';
    }
    add_filter('geodir_breadcrumb_first_link', 'modify_breadcrumb_first_item');

    Use child theme or this plugin to apply the code.
    https://wordpress.org/plugins/code-snippets/

    #251402

    Ray Scarpa
    Expired Member
    Post count: 84

    Much appreciated! We are using a child theme, wondering if you can confirm which file to edit? Is this code to add to functions.php or somewhere else? Trying to avoid additional plugins if possible. Thanks!

    #251530

    Ray Scarpa
    Expired Member
    Post count: 84

    Dropped the above code into the child theme functions.php document and it worked perfectly. Thanks so much!

    #251534

    Giri
    Expired Member
    Post count: 3155

    Ray,
    Sorry for the late reply. Our team members are from different timezones. I just got back to work.

    All our custom codes goes in child theme’s functions.php file unless otherwise specified.

    If it doesn’t goes in functions.php file then most likely we will apply the changes on your behalf 99% of the time.

    Thanks

    #258681

    Karin Palle
    Expired Member
    Post count: 11

    Is there code available for the functions.php file that would let us change where the “View all” link sends people? It would be great if that could be more set to be specific to showing all special offers or feature listings, not all places. Alternatively, could View all be hidden since it is causing some confusion.

    #259051

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    If your defaul sort is “featured” it will show featured listings on top. It is not possible to show only special offers though.

    you can hide it with css adding this in GD > design > scripts > custom css:

    
    
    .geodir_list_heading a.geodir-viewall {
      display: none;
    }

    Thanks

    #260333

    Karin Palle
    Expired Member
    Post count: 11

    Thanks. I think I’ll just hide the link. I do have a shortcode set up with the listings that have special offers, but it has the same View All link displayed and people think they’ll get to see all offers. 🙂

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount