WordPress.org

Ready to get started?Download WordPress

Forums

Parse error: syntax error, unexpected T_ELSE (2 posts)

  1. nickelbert
    Member
    Posted 4 years ago #

    page.php
    ----------------------------
    <?php get_header(); ?>
    <div id="content">

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

    <div class="post" id="post-<?php the_ID(); ?>">
    <h2><?php the_title(); ?></h2>
    <span class="post-cat"><?php the_category(', ') ?></span>
    </div>
    <div class="entry">
    <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>

    <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    </div>

    <?php comments_template(); ?>
    </div>

    <?php endwhile; endif; ?>

    <div class="navigation">
    <span class="previous-entries"><?php previous_post_link('%link')?></span>
    <span class="next-entries"><?php next_post_link('%link')?></span>
    </div>

    <?php else : ?>

    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn't here.</p>

    <?php endif; ?>

    </div>
    <!--/content -->

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

    It says I have an unexpected parse error of T_ELSE on line 26 which is
    <?php else : ?>

    Any help would be great.

  2. Arnold Goodway
    Member
    Posted 4 years ago #

    Just above the navigation class you have this:

    <?php endwhile; endif; ?>

    You need to delete the last endif bit.

Topic Closed

This topic has been closed to new replies.

About this Topic