WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Parse error: syntax error, unexpected T_ENDWHILE in loop.php on line 168 (10 posts)

  1. thoughtpalettechris
    Member
    Posted 4 years ago #

    Kind've an oddball support ticket.

    I have made a child theme off twenty ten, every things been going great.

    Then I test my search bar. It works correctly when there are no relevant search results, ie it takes me to the search.php page with correct styling/formatting.

    The problem I have is when there are supposed to be results, ie the title of a post, I get this error.

    I checked it out on a syntax checker and it said the same thing. Line 168 in loop.

    I removed that line as I did not see any code structure errors, the page worked, but didn't show up results.

    Can anyone let me know whats going on? :}

    really appreciate it. btw the default loop.php I'm using is from the twenty-ten theme. Code below.

    [code moderated as per forum rules - please use the pastebin - it has the added advantage of line numbers]

  2. thoughtpalettechris
    Member
    Posted 4 years ago #

    <?php endwhile; // End the loop. Whew. ?>

    Is where I'm getting the syntax error.

  3. thoughtpalettechris
    Member
    Posted 4 years ago #

    Still nothing working.

  4. keesiemeijer
    moderator
    Posted 4 years ago #

    Can you put the full content of the search.php template in the pastebin
    try also <?php endwhile; /* End the loop. Whew. */ ?>

  5. thoughtpalettechris
    Member
    Posted 4 years ago #

    http://pastebin.com/1ATrPRZ5

    Here it is.

    I tried <?php endwhile; /* End the loop. Whew. */ ?> to no avail.

    Thanks for your help in this matter!

  6. keesiemeijer
    moderator
    Posted 4 years ago #

    ok, sorry, I need your loop.php in the pastebin.

  7. thoughtpalettechris
    Member
    Posted 4 years ago #

  8. keesiemeijer
    moderator
    Posted 4 years ago #

    You don't have a while in there, try changing this (not tested):

    <?php /* How to display posts in the Gallery category. */ ?>

    to this:

    <?php /* How to display posts in the Gallery category. */ ?>
    <?php while ( have_posts() ) : the_post(); ?>
  9. thoughtpalettechris
    Member
    Posted 4 years ago #

    That worked! Thank you so much! <3

  10. keesiemeijer
    moderator
    Posted 4 years ago #

    You're welcome. Glad you got it working.

Topic Closed

This topic has been closed to new replies.

About this Topic