Breadcrumbs – keep on Geodirectory pages, don't load on other pages?

This topic contains 12 replies, has 3 voices, and was last updated by  Paolo 9 years, 4 months ago.

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

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #46135

    wasanajones
    Buyer
    Post count: 180

    Been playing with functions php but can’t figure it out

    can you offer an edit if so that geodir_breadcrumb displays on geodirectory custom post types and regular wordpress posts, but not on pages ?

    right now I have
    add_filter(‘geodir_breadcrumb’,’geodir_breadcrumb_remove’,10,2);
    function geodir_breadcrumb_remove($breadcrumb, $separator){
    return ”;
    }

    BTW with that snippet .geodir-breadcrumb-bar still loads on pages it is just empty

    thanks

    #46240

    Paolo
    Site Admin
    Post count: 31206

    I’m not sure I understand the question.

    GeoDir breadcrumbs are only showing on GD pages. If you want to add them to WP Posts, you shouldn’t be using a function to remove them.

    You would just call the function https://wpgeodirectory.com/docs/codex/geodirectory_functions/geodir_breadcrumb/ where u want it or add a hook to call it if ur template has hooks.

    Let us know how you went,

    Thanks

    #46292

    wasanajones
    Buyer
    Post count: 180

    GeoDir breadcrumbs are only showing on GD pages.

    Actually that is not true. On Genesis themes with breadcrumbs disabled in Genesis Theme Settings,

    <div class=”geodir-breadcrumb-bar”>
    <div class=”wrap”>
    <div class=”geodir-breadcrumb clearfix”>
    <ul id=”breadcrumbs”>

    is being generated on standard wordpress posts and pages

    The desired affect for me is to Not have geodirectory breadcrumbs on Pages.

    I’d show you the site but it is behind an under construction wall

    #46295

    wasanajones
    Buyer
    Post count: 180

    as a brief follow up, it would be best to only have GD breadcrumbs on GD pages and let Genesis control the others, because GD is inserting the breadcrumb above the genesis .site-inner div, sort of breaking the layout

    #46370

    Paolo
    Site Admin
    Post count: 31206

    Hi again,

    I can confirm this is an oversight on our side. I’ve flagged this for Stiofan.

    We will keep you posted.

    Thanks

    #46374

    wasanajones
    Buyer
    Post count: 180

    great, thanks

    #46375

    wasanajones
    Buyer
    Post count: 180

    it might be worth noting that related to this is that on generated pages like, Places | Search Results GD is inserting above the content area (.site-inner on Genesis) – meaning it is outside the formatting and requires adding CSS to control it, a fixed-width site suddenly has full-width content

    for example on a genesis theme
    <header class=”site-header” xxx>
    <nav class=”nav-secondary” xxx>HEADER AREA

    <section id=”popular_post_category-3″ class=”widget geodir-widget geodir_popular_post_category”>
    <div class=”geodir-category-list-in clearfix”>
    <div class=”geodir-cat-list clearfix”>
    <div class=”geodir-cat-list-more” style=”display:none;”>
    </div>
    </section>
    <section id=”geodir_advance_search-3″ class=”widget geodir-widget geodir_advance_search_widget geodir-advance-search-default” data-show-adv=”default”>
    </div>
    <div class=”geodir-breadcrumb-bar”>

    <div class=”site-inner”>THIS IS WHERE CONTENT NORMALLY STARTS

    #46379

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    that is normal and it’s been done on purpose to allow full width maps, you can simply avoid using that widget area or add 1 line of css to box it like the rest of the website.

    Thanks

    #46389

    wasanajones
    Buyer
    Post count: 180

    that makes sense

    #46408

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello,

    This should be what you are after?

    
    
    add_action( 'wp', 'remove_gd_breadcrumb_from_pages' );
    function remove_gd_breadcrumb_from_pages(){
    global $post;
    	if(is_page()){ 
    	remove_action('genesis_after_header', 'geodir_replace_breadcrumb', 20);
    	}
    }

    Thanks,

    Stiofan

    #46409

    wasanajones
    Buyer
    Post count: 180

    Hi – thanks for follow-up.

    that does what I originally asked for, but now I’m looking at the WP Post types and anticipating other custom post types (products) and it is sort of mucking up the default layout. (geodir breadcrumb shows up in a different place than genesis breadcrumb)

    can you write that so that instead of excluding from types, we simply include on geodir post types ?

    sorry to be a bit wishy washy, but it is more universal for things that will be added later

    #46410

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You could prob do something like this (not tested, just finifhing for the night)

    
    
    remove_action('genesis_after_header', 'geodir_replace_breadcrumb', 20);
    
    add_action('after_setup_theme', 'my_gd_compat_php_genesis', 12);
    function my_gd_compat_php_genesis()
    {
    //  GD BREADCRUMBS
        add_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
        add_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
        add_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
        add_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
        add_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
        add_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
    }

    Stiofan

    #46508

    Paolo
    Site Admin
    Post count: 31206

    Please let us know if we can set this as resolvd.

    Thanks

Viewing 13 posts - 1 through 13 (of 13 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