Syntax error index.php page help needed

  • Unknown's avatar

    Hi there

    Doing my first basic theme and hitting a syntax error on two lines “<?php endwhile; ?>
    ” and “<?php else : ?>” could someone advise please

    <?php get_header(); ?>
    <?php if (have_posts()) ; ?>
    <?php while (have_posts()) ; the_post(); ?>
    <article <?php post_class() ?> id='post-<?php the_ID(); ?>">
    	<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
        posted on: <?php echo get_the_date(); ?> at <?php echo get_the_time(); ?>
        Posted in: <?php the_category(','); ?>
    
    <?php the_content('Read More..'); ?>
    posted by: <?php the_author(); ?> | <?php comments_popup_link ('No Comments', '1 Comments', '% Comments'); ?>
    </article>
    
    <?php endwhile; ?>
    <?php next_post_link('&laquo; Previous Entries') ?>
    <?php previous_post_link('Next Entries &raquo;') ?>
    <?php else : ?>
    <p>Not Found</p>
    <p>Sorry, but you are looking for something that isn't here.</p>
    <?php endif; ?>
    </section>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi danielwaddon,

    This support forum is for blogs hosted at WordPress.com. Your question is specifically for a self-hosted installation of WordPress. You will need to seek help at https://wordpress.org/support/forum/themes-and-templates for theme help.

    Double check your code against this example.

  • Unknown's avatar

    Hi

    Oh sorry I did not know there was two forums.

    I’ll repost

  • Unknown's avatar

    No worries, @danielwaddon!

    Did you see the example in my last reply?

  • Unknown's avatar

    No I did not but I’ll have a look when I’m next with my laptop.

    Thanks again ;)

  • The topic ‘Syntax error index.php page help needed’ is closed to new replies.