WordPress.org

Forums

Excluding Multiple Categories (5 posts)

  1. mlke
    Member
    Posted 8 years ago #

    http://codex.wordpress.org/Template_Tags/query_posts

    this url tells me how to do it, but when i use the example code, it doesn't work

    Parse error: parse error, unexpected T_ENDIF on line 17

    line 17 = <?php endif; endwhile; ?>

    ?

  2. Kafkaesqui

    Posted 8 years ago #

    Possible your loop code doesn't employ an if statement? try this for line 17:

    <?php endwhile; ?>

    If that still causes problems, paste your template here:

    http://wordpress.pastebin.ca

    and reply back with the url for it so we can check out the coding.

  3. mlke
    Member
    Posted 8 years ago #

  4. Kafkaesqui

    Posted 8 years ago #

    Ah, it's just a mix-up on the if statement's 'punctuation.' Change that line to:

    <?php } endwhile; ?>

    When a conditional or loop statement begins like:

    if() {

    Then you need to provide a closing bracket. When it opens like:

    if() :

    then you close it with endif; -- merely two ways to do the same thing in PHP.

  5. mlke
    Member
    Posted 8 years ago #

    thank you kindly

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.