WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get the line of codes below to display it's content on "web-design-portfolio" and "web-design-portfolio-2" but it ends up messing up every other pages on my website and displays the "Ul" element on them. Any ideas what the problem could be.


is_page(array('web-design-portfolio','web-design-portfolio'));  { ?>

<div id="content-box-gallery">

      <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

            <h2><a href="<?php the_permalink() ?>"></a></h2>

            <?php if( has_post_thumbnail() ) { ?>

          <div id="thumber">  <?php the_post_thumbnail($size, $attr); ?></div><?php } ?>

            <?php the_content(); ?>

            <?php endwhile; else: ?>


<p>Sorry, no posts we're found.</p>

            <?php endif; ?>

            <li><a href="http://siteripe.com/web-design-portfolio/">&laquo;</a></li>
            <li><a href="http://siteripe.com/web-design-portfolio/">1</a></li>
            <li><a href="http://siteripe.com/web-design-portfolio-1/">2</a></li>
            <li><a href="http://siteripe.com/web-design-portfolio-1/">&raquo;</a></li>

</div><!-- End Content Box  Gallery --> 

  <?php } ?>
share|improve this question
up vote 2 down vote accepted

is_page() returns boolean true or boolean false. The way you've called it looks like it would have no effect.

Try this:

if ( is_page( array( 'web-design-portfolio', 'web-design-portfolio-2' ) ) ) {

<!-- All your display code code -->

<?php }   // ends the if() statement
share|improve this answer
Thanks Pat. That works perfectly. – Dz.slick Apr 18 '13 at 4:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.