How to hide breadcrumb on home page only?
-
Hi
Can someone tell me please how to hide the breadcrumb on the home page only?
See the Home > 1 in the grey box under the slider? I don’t want the grey box or the breadcrumb there, but I do want the breadcrumbs as they are on the interior pages.
Thanks in advance!
Laura
This is something that I wanted to sort out for my site. Here is the code I added to my functions.php:
/******
* these next two remove the graphene breadcrumb and then add one
* which does not appear on the home page
*****/
// has to be called after the action is added
add_action ('after_setup_theme', 'wmrt_remove_graphene_bc');
function wmrt_remove_graphene_bc() {
remove_action ('graphene_top_content', 'graphene_breadcrumb_navxt');
}
add_action('graphene_top_content', 'wmrt_breadcrumb_navxt');
function wmrt_breadcrumb_navxt () {
//by calling this at this point is_home() works!
if ((function_exists('bcn_display')) && (!(is_home()))) {
echo '<div class="breadcrumb">';
bcn_display();
echo '</div>';
}
}I haven’t logged in for awhile and I just went to log in and I get this error:
Warning: Cannot modify header information – headers already sent by (output started at /home/juicytrv/public_html/wp-content/themes/graphene-child/functions.php:37) in /home/juicytrv/public_html/wp-includes/pluggable.php on line 934
Line 37 is where I added that new breadrumb text we worked on. I’m not sure I logged in since, I think not. If I remove it, I still can’t log in. Any ideas? I’m totally stuck and of course sitting down to work for the day but can’t get in…any help much appreciated!
Oh, and here is my child functions.php file if that helps. Did I put the php tags in the wrong place or way or something?
<?php
function graphene_slider_post_types(){
return array('post', 'page');
}
add_filter( 'graphene_slider_post_type', 'graphene_slider_post_types' );
?>
<?php
// attaches the function my_post_nav to the hook graphene_post_nav
add_action ('graphene_after_post_content', 'my_post_nav');
// our function
function my_post_nav(){
// this will allow us to use other hooks but still only show on single posts
if ( is_single() && ! is_page() ) : ?>
<div id="my-post-nav"> <!-- div to contain your links -->
<?php previous_post_link_plus( array(
'order_by' => 'menu_order',
'loop' => false,
'max_length' => 0,
'tooltip' => 'Previous page',
'in_same_cat' => true,
'ex_cats' => '12'
) );?> |
<?php next_post_link_plus( array(
'order_by' => 'menu_order',
'loop' => false,
'max_length' => 0,
'tooltip' => 'Next page',
'in_same_cat' => true,
'ex_cats' => '12'
) );?>
</div>
<?php endif; ?>
<?php } ?>
<?php
/******
* these next two remove the graphene breadcrumb and then add one
* which does not appear on the home page
*****/
// has to be called after the action is added
add_action ('after_setup_theme', 'wmrt_remove_graphene_bc');
function wmrt_remove_graphene_bc() {
remove_action ('graphene_top_content', 'graphene_breadcrumb_navxt');
}
add_action('graphene_top_content', 'wmrt_breadcrumb_navxt');
function wmrt_breadcrumb_navxt () {
//by calling this at this point is_home() works!
if ((function_exists('bcn_display')) && (!(is_home()))) {
echo '<div class="breadcrumb">';
bcn_display();
echo '</div>';
}
}
?>Interesting, if I rename the child functions theme file so it’s not used, I can log in.
Then I just renamed it back to functions.php again in the theme folder after I was logged in and its ok once I’m in. So it seems something in that added code is making it so I just can’t log in? Now that I’m in I could disable plug ins or what not, but I don’t know what’s causing the conflict. I think maybe that last breadcrumb code since that was the last thing I added I think but not sure. Any help appreciated. Why is it giving me the error to log in?
Thanks
Viewing 10 posts - 1 through 10 (of 15 total)
- 1
- 2
- You must be logged in to reply to this topic.
