• For some reason the text after my closing “else” statement won’t show up when there are no posts. Can someone take a look at this? I have multiple loops on the page, but I’m sure I have everything set up. The code works, but this line doesn’t.

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter get_username

    (@get_username)

    Thread Starter get_username

    (@get_username)

    Anyone? This seems like any easy fix. If someone could quickly look through my code above to make sure I’m not missing something it would be most appreciated.

    Thread Starter get_username

    (@get_username)

    Please let me know if I need to explain further.

    if (have_posts()) only checks the default query_string, and if this is a page template (I assume ?), there this query_string contains the page (even if the content is empty); you need to check the individual custom queries:

    try and change this line (line 5 of the pastebin):

    <?php if (have_posts()) : ?>

    to:
    <?php if($query_basic->have_posts()) : ?>

    same for line 36; change to:
    <?php if($query_advanced->have_posts()) : ?>

    again for line 67; change to:
    <?php if($query_urban->have_posts()) : ?>

    Thread Starter get_username

    (@get_username)

    That was it! Thanks for taking a look. I knew it was something simple.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘No posts statement not showing up’ is closed to new replies.