Viewing 5 replies - 1 through 5 (of 5 total)
  • No. All available orderby options are listed in this Codex section. what is it that you are trying to do? List posts according to categories – ie Cat 1 posts followed by Cat 2 posts etc?

    Thread Starter susheel kumar

    (@susheel-kumar)

    Yes exactly. I want to order posts by category something like this
    cat1
    post1
    post2
    post3
    cat2
    post1
    post2
    post3


    Is it possible by using simple wp_query() or i have to get the categories then loop through the category id. But in this case i have another issue with pagination.

    You’ll need to use the second option – grab the categories and then step through them launching a new query & Loop for each category. And, yes, I can see how that’s going to create a pagination issue but I don’t think there’s any other way of doing this.

    Thread Starter susheel kumar

    (@susheel-kumar)

    Thanks for your support esmi.

    I have the same problem but I have got the posts by category. Still facing issue for paging.

    ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Maintain the post order according to category name in WP_Query?’ is closed to new replies.