• I am redesigning my site but keep getting this error: Parse error: parse error, unexpected $ in /home/triple7/public_html/blog/index2.php on line 131
    The thing is my code on has 126 lines. What’s goin one?

Viewing 9 replies - 1 through 9 (of 9 total)
  • make a copy as index2.phps and put up a link. It will be easy to fix, just can’t tell you what’s wrong without first seeing the code.

    Thread Starter triple7

    (@triple7)

    You have some redundancy in your index – the start of the loop twice. Delete from <div id="content"> down to the second <div id="content"> (or up)

    Thread Starter triple7

    (@triple7)

    LOL! This is why i shouldnt code in the middle of the night… but now I have another problem…
    Parse error: parse error, unexpected T_ENDFOREACH in /home/triple7/public_html/blog/index2.php on line 56
    line 56 is
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    I;m no PHP expert but I don’t see anything wrong here.

    the line before that must have been

    <?php endforeach; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>

    the endforeach is for the foreach (posts) that you have up there where the loop for the posts begins. Try and see if you have only one endforeach, and if the braces match.

    Shoot, it is almost 2 a.m. and I’ve GOT to get to bed. You didn’t update the txt file with what you have now. Do that and I will tell you what is wrong in the morning (if no one else has).

    Thread Starter triple7

    (@triple7)

    erm… lets see.

    <?php endforeach; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>

    that is the only endforeach. braces seems okay, but like i stated, i am only a beginner at PHP.

    could you please post the entire index.php like you did earlier, calling it index.php.txt so we can see what else could be wrong?

    Yup, Beel is right ??
    Add
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    just before the
    <?php the_date('','<h2>','</h2>'); ?>
    line
    so it looks like the following when you are done:

    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <?php the_date('','<h2>','</h2>'); ?>
    <div class="post">

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Parse error on a line that doesn’t exist!’ is closed to new replies.