• Resolved classna

    (@classna)


    I am trying to display the latest 5 posts on my homepage using the following code:

    query_posts('cat=-9&showposts=5&orderby=date&order=desc' );

    I am excluding category 9 in this case. It works fine but the orderby=date is not working. I want to display the newest post first here. If you remove the category filter, i.e. cat=-9 the orderby=date works but with the category exclusion filter, it doesn’t. I am stuck here and searched everywhere for a possible fix. Please help.

    P.S. i also disabled all the plugins if that might have caused this but still no luck.

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

The topic ‘query_posts orderby=date not working when i exclude a category’ is closed to new replies.