• Resolved wrdprs

    (@wrdprs)


    Hi,

    I’m a PHP newbie, and like a true newbie, i didn’t back up my code before i started screwing around with it. Needless to say, i broke my page, and i can’t fix it. Hoping to reach out to the community for some help with this.

    ERROR: Parse error: syntax error, unexpected T_ENDWHILE
    LINK: http://intherough.tv/golf-trivia/
    CODE: http://pastebin.com/mzBZjXmA

    The reason i was messing with the code is that i’m trying to add an ‘older post & newer post’ link to the template. If anyone can include the code to do so in their solution that would be greatly appreciated.

    Thanks so much in advance.

    -Mike

Viewing 4 replies - 1 through 4 (of 4 total)
  • To fix your problem try removing <?php endwhile; ?> at line 129. Seems like your while loop has ended at line 92 already. Hope that helps. I am not quite sure how to do your next/previous page.

    Thread Starter wrdprs

    (@wrdprs)

    Hey grx. Thanks for your response. I tried your suggestion but it spit another error at me.

    Parse error: syntax error, unexpected $end on line 159.

    I think there must be some formatting that i accidentally deleted when trying to add the next/previous page code.

    Thread Starter wrdprs

    (@wrdprs)

    If anyone could offer some insight into this, it would be greatly appreciated. I really need your help to get this solved.

    Ok, it seems like u’ve messed up a bit. Let’s see if I can help you:

    lines 105-107 replace with:

    $query = new WP_Query('cat=12&showposts=5');
    while($query -> have_posts()) : the_post();

    You could include all this while->endwhile within if->endif but lets assume query will return any posts for now.

    then at line 118 insert missing endif (from thumbnail check)
    <?php endif; ?>

    File should be fixed after that. As for next previous links. By default wordpress does it like this:

    <?php previous_post_link( '%link', __( '<span class="meta-nav">←</span> Previous', 'twentyeleven' ) ); ?>
    <?php next_post_link( '%link', __( 'Next <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>

    Didnt dig too deep into that links but u can check WP documentation for details:
    documentation

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Pls Help – Parse error: unexpected T_ENDWHILE’ is closed to new replies.