• candya21

    (@candya21)


    I want to test if the page being displayed is the “Testimonials” page and I can’t get it working for some reason. I get a “Parse error: syntax error, unexpected $end in ..” error.

    I have this placed right after my ” get_header() ” command:

    <?php if ( is_page(‘testimonials’)) : ?>
    <div class=”page”>
    <div id=”copy”>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <h3>
    <?php the_title(); ?>
    </h3>
    <div class=”testimonials”>
    <?php the_content() ; ?>
    </div><!– /testimonials –>

    <?php endwhile; ?>

    </div><!– /page –>
    </div><!– /copy –>
    </div><!– /content –>

    <div id=”bottom_content”></div>
    </div><!–/contentWrapper–>
    </div><!– /left column –>

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    <?php elseif (is_page()) : ?>
    <div class=”page”>
    <div id=”copy”>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <h3>
    <?php the_title(); ?>
    </h3>

    <?php the_content() ; ?>

    <?php endwhile; ?>

    <?php else : ?>
    <h2 class=”center”>Not Found</h2>
    <p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
    <?php get_search_form(); ?>
    <?php endif; ?>

Viewing 1 replies (of 1 total)
  • Michael

    (@alchymyth)

    the full error message would have helped; it tells you the line where the error occurs.

    the ‘endif’ of the first ‘if(have_posts())’ is missing; and the ‘endif’ of the ‘if(is_page(‘testimonials’))’ is mising as well.

Viewing 1 replies (of 1 total)
  • The topic ‘Does an is_page have to be placed in beginning of php file?’ is closed to new replies.