Does an is_page have to be placed in beginning of php file?
-
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; ?>
- The topic ‘Does an is_page have to be placed in beginning of php file?’ is closed to new replies.