• cscott5288

    (@cscott5288)


    OK, so I designed my first theme and I am trying to test it out. I have all of the 12 core files uploaded, and I go to preview the theme but I get this:

    Parse error: syntax error, unexpected ‘)’ in URL-of-index.php on line 7

    Below is my index.php … I just can’t figure out what is causing this. Please let me know if you need any other files. Thanks!

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    
    <div class="mid-content">
    <div class="homecontent-wrapper">
    
    <?php if (have_posts)()) : ?>
    <?php while (have_posts)()) : the_post(); ?>
    
    	<div <?php post_class() ?>>
    
    <h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
    <?php endif; ?>
    
    <?php the_content(''); ?>
    <ul class="meta">
    <li><?php the_time('F jS, Y') ?></li>
    <li>Posted in <?php the_category(', ') ?></li>
    <li><?php comments_number('No Comments','1 Comment','% Comments'); ?></li>
    </ul>
    </div>
    
    <?php endwhile; ?>
    
    <div class="pagination">
    <ul>
    <li><?php next_posts_link('Older') ?></li>
    <li><?php previous_posts_link('Newer') ?></li>
    </ul>
    </div>
    
    </div>  // close mid-content div
    </div>  // close homecontent-wrapper div
    
    <?php else : ?>
    <h2>Nothing found</h2>
    <p>Sorry, but you are looking for something that isn't here.</p>
    <p><a href="<?php echo get_option('home'); ?>">Return to the homepage</a></p>
    <?php endif; ?>
    
    <?php get_footer(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Len

    (@lenk)

    Hi cscott5288,

    The error (which occurs twice) is here …

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

    It should read …

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

    (@cscott5288)

    Thank you so much!

    Wow, I discovered I had a whole lot of errors too, like the unnecessary endif on the 16th line. About 2/3rds of core files are not working.. I have a lot of tweaking to do.

    Len

    (@lenk)

    Heh, I know from experience how easy it is to miss something obvious after staring at a screen full of code for hours at a time. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘my first theme – getting a parse/syntax error in php’ is closed to new replies.