Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

<?php 

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

            <h2>Woops...</h2>

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

            <?php endif; ?>

          <ul>
            <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>
           </ul>

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


  <?php } ?>
share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.