Trouble with a conditional statement
-
I am using the following to get a selection of posts from a certain category:
<ul> <?php $recent = new WP_Query("cat=91&showposts=5"); while($recent->have_posts()) : $recent->the_post();?> <li><a href="<?php the_permalink() ?>" rel="bookmark"> <?php the_title(); ?> </a></li> <?php endwhile; ?> </ul>However what I want to do is wrap the whole thing in an IF statement so that it only shows up on a certain page. I have tried multiple ways but keep coming back with PHP errors.
Is there an easy way to wrap the code above in an IF statement that basically says if it is page 2 output this? I’m sure there is but it’s driving me mad at the minute!
Thanks for the help.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Trouble with a conditional statement’ is closed to new replies.