Conditional content based upon is_page() not echoing as expected
-
Greetings!
I have a block of code that looks like this:
<?php
if (is_page()) {
echo ‘Something for Pages’;
} else {
echo ‘Something for Posts’;
}
?>Unexpectedly, the ‘Something for Posts’ shows on Pages as well as Posts.
What am I doing wrong?
Apologies for the lack of links – These experiments (my first WP sites, really) only exist on my dev box for now…
TIA!
Gilad
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Conditional content based upon is_page() not echoing as expected’ is closed to new replies.