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 } ?>

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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