• Resolved Uthred

    (@uthred)


    I have the loop set up on my main blog page to only show posts from the “Blog” category, I have navigation at the bottom set up to show if there are more than X number of posts on the page. However whats happening is that the code is generating a first page on which it shows no posts (so its correctly not showing any posts not in the Blog category but they are still “taking up space” as it were) but shows a link to older posts i.e. the actual posts in the Blog category.

    And advice on simply removing not blog category posts from the “flow” entirely would be greatly appreciated.

    The code is as follows:

    [code moderated - use the pastebin for any code over the forum limit of 10 lines]

Viewing 1 replies (of 1 total)
  • TadeuszD

    (@tadeuszd)

    Your loop is always going through all posts in your blog. It’s normal that navigation links hits to all next/previous post without respect to your “show-category-filter”.
    You can correct this using query_posts('category_name=Blog'); before the loop to select posts only with specified category. No another “filters” inside the loop is needed…

Viewing 1 replies (of 1 total)
  • The topic ‘The loop showing "phantom" posts’ is closed to new replies.