How to Target Static Posts Page
-
Here are the details:
? made a static page my front page and specified another page to work as my posts page (titled ‘Blog’) using the Reading settings.
? in header.php, I wrote a simple if/else if statement to serve up a different header image depending on which page it is, using (for example)is_page('Blog')
as the conditional.
? it works with all the pages except the Blog page, which picks up the default image no matter how I try to refer to the Blog page (title, slug, etc).
? I tried usingis_posts_page
, but since most pages are posts pages of one kind or another, that trumps my default image in undesired ways.I have a feeling that the error is occurring because of the Reading settings and I’m just not putting in the right identifier to target that page, but I’m also not clear on why the
is_page
isn’t working, since the page still has a title and the title is being used in the function.Any help/insight is appreciated.
- The topic ‘How to Target Static Posts Page’ is closed to new replies.