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, 3 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: breadcrumb
-
AuthorPosts
-
July 18, 2015 at 8:41 pm #46135
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
July 20, 2015 at 2:54 pm #46240I’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
July 20, 2015 at 9:05 pm #46292GeoDir 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
July 20, 2015 at 9:35 pm #46295as 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
July 21, 2015 at 2:21 pm #46370Hi again,
I can confirm this is an oversight on our side. I’ve flagged this for Stiofan.
We will keep you posted.
Thanks
July 21, 2015 at 2:46 pm #46374great, thanks
July 21, 2015 at 3:03 pm #46375it 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
July 21, 2015 at 3:25 pm #46379Hi,
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
July 21, 2015 at 4:22 pm #46389that makes sense
July 21, 2015 at 5:59 pm #46408Hello,
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
July 21, 2015 at 6:15 pm #46409Hi – 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
July 21, 2015 at 6:22 pm #46410You 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
July 22, 2015 at 3:03 pm #46508Please let us know if we can set this as resolvd.
Thanks
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket