is_home() breaking posts page
-
I currently have a different header image for each page on a site I’m working on. I did this with php and also a wordpress plugin called dynamic headers. I used php coding like so:
<?php if( is_page(array('bio','videos','photos','events','sponsors','store',)) ){ ?> <div id="slideshow"> <div id="slidesContainer"> <div class="slide"> <?php if(function_exists('show_media_header')){ show_media_header(); } ?> </div> </div> </div> <?php } ?>
So this is telling wordpress to use the custom header (show_media header) whenever you are on the bio, videos, photos, events, sponsors, or store pages. I also have this code:
<?php if( is_404() || is_front_page() || is_category( array( 912, 'uncategorized', 'articles' ) ) || comments_open() || is_search() ){ ?> Content, content, content, content etc. <?php } ?>
This is telling wordpress that when its on the front page, pages with comments, search pages, 404 page to use the content I posted within the code.
Now, all of this worked fine, there were separate headers for each page, for every other page there was a slideshow header. Just recently, I changed my blog so the mainpage is a static page and the posts page is set to my news page. The front mainpage has the slideshow images, which I want. Then the blog page (news) is the exact same as the front page, when it should be a seperate image that I assigned to it. I tried to fix it so the blog news page shows up as a different header image like all the other pages, but it did not work.
Here’s what I tried to do to fix it:
I added ‘news’ and even is_home() to my php code that tells wordpress to have its own header for each page:
<?php if( is_page(array(‘news’,’bio’,’videos’,’photos’,’events’,’sponsors’,’store’,)) || is_home() ){ ?>When I add the is_home code, the header breaks, nothing happens when I add the ‘news’ to the is_page array. So I’m pretty confident the is_home is the correct coding. But for some reason, the slideshow header is showing up on the news page when it shouldn’t. The news page should show its own header.
If anyone has any idea of what to do, please help me! It would honestly mean the world ??
- The topic ‘is_home() breaking posts page’ is closed to new replies.