PHP conditional Body ID's Causing double scrollbar
Posted: Thu Jul 22, 2010 11:28 am
Hi all. Thanks for welcoming me to the community.
I'm currently creating a photo blog that uses fullsize page images where the body css calls for overflow:hidden (no scrollbars). On pages other than the index.php i wanted scrollbars for a more traditional blog look. The problem is on single pages of one of the categories I am getting a double scrollbars.
I can clearly see that its loading two sets of bodies in one because of the is_category and in_category being applied. Wondering if there is a way to say to take the css of the child element instead of both.
CSS: body#home, body#blog{
background: #fff url(images/bikeback.gif);
background-repeat:no-repeat;
color: #000;
font-size: 62.5%;
font-family: Helvetica,arial, verdana, sans-serif;
overflow:hidden;
background-position:center top;
width:100%;height:100%;
}
body#interviews{overflow:visible;background: #fff url(images/archiveback.jpg); background-repeat:repeat-x;background-position:top center;margin:0;padding:0;font-size: 62.5%;
font-family: Helvetica,arial, verdana, sans-serif;
}
body#interviews_single{overflow:inherit;background: #fff url(images/archiveback.jpg); background-repeat:repeat-x;background-position:top center;margin:0;padding:0;font-size: 62.5%;
font-family: Helvetica,arial, verdana, sans-serif;
}
PHP:
<?php if (in_category('interviews') || is_category('blog') || is_archive()) { ?>
<body id="interviews">
<?php } elseif (in_category('blog') ) { ?>
<body id="blog">
<?php } elseif (is_single() ||$post->post_parent == '4' ) { ?>
<body id="interviews_single">
<?php }else { ?>
<body class="home">
<?php } ?>
http://bicyclecatwalk.com/category/interviews
If you click on the thumbnails linked to the individual post you'll see the effect of two body ids at work? Becoming overly frustrated on this one. Would love some help
Cheers!
I'm currently creating a photo blog that uses fullsize page images where the body css calls for overflow:hidden (no scrollbars). On pages other than the index.php i wanted scrollbars for a more traditional blog look. The problem is on single pages of one of the categories I am getting a double scrollbars.
I can clearly see that its loading two sets of bodies in one because of the is_category and in_category being applied. Wondering if there is a way to say to take the css of the child element instead of both.
CSS: body#home, body#blog{
background: #fff url(images/bikeback.gif);
background-repeat:no-repeat;
color: #000;
font-size: 62.5%;
font-family: Helvetica,arial, verdana, sans-serif;
overflow:hidden;
background-position:center top;
width:100%;height:100%;
}
body#interviews{overflow:visible;background: #fff url(images/archiveback.jpg); background-repeat:repeat-x;background-position:top center;margin:0;padding:0;font-size: 62.5%;
font-family: Helvetica,arial, verdana, sans-serif;
}
body#interviews_single{overflow:inherit;background: #fff url(images/archiveback.jpg); background-repeat:repeat-x;background-position:top center;margin:0;padding:0;font-size: 62.5%;
font-family: Helvetica,arial, verdana, sans-serif;
}
PHP:
<?php if (in_category('interviews') || is_category('blog') || is_archive()) { ?>
<body id="interviews">
<?php } elseif (in_category('blog') ) { ?>
<body id="blog">
<?php } elseif (is_single() ||$post->post_parent == '4' ) { ?>
<body id="interviews_single">
<?php }else { ?>
<body class="home">
<?php } ?>
http://bicyclecatwalk.com/category/interviews
If you click on the thumbnails linked to the individual post you'll see the effect of two body ids at work? Becoming overly frustrated on this one. Would love some help
Cheers!