Conditional statement didn't work as expected.
-
I want to display text on the first page of my posts, and different text on subsequent pages. I have a static front page, with posts at ‘clips’.
I thought I’d be ok in adding this to home.php:
<?php if (! is_home() && !is_paged()) {echo 'Text for first page.';} else {echo 'Text for subsequent pages.';} ?>But it doesn’t work (the text for subsequent pages also appears on the first page). So, to get it to do what I wanted, I re-coded as:
<?php if (! is_page('clips') && !is_paged()) {echo 'Text for first page.';} else {echo 'Text for subsequent pages.';} ?>I’m wondering why the is_home statement didn’t work.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Conditional statement didn't work as expected.’ is closed to new replies.