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

  1. nickelbert
    Posted 6 years ago #

    <?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 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')); ?>

    <?php comments_template(); ?>

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

    <?php else : ?>

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

    <?php endif; ?>

    <!--/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
    Posted 6 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