How to Query Posts Per Category

This topic contains 2 replies, has 2 voices, and was last updated by  Paolo 9 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: , ,

  • Author
    Posts
  • #37390

    stargeoteam
    Full Member
    Post count: 33

    Hi ,

    I’m trying to use query_posts function. I’m trying to filter by category. I simply just want to be able to filter and get the posts per category per geodirectory post type and use it in the loop.

    A. Input Category ID.
    B. Input Geodirectory Post type.

    $args = (‘post_type=gd_place&cat=11’);

    or

    $args = array( ‘post_type’ => ‘gd_place’, ‘category’ => 11
    );

    query_posts($args);

    1. If I include category it doesn’t work.
    2. If I exclude category it will work.
    3. Is there a way to properly do this for Geo Directory post types?

    Thanks

    #37392

    stargeoteam
    Full Member
    Post count: 33

    1. I used tax_query.

    Resolved.

    #37426

    Paolo
    Site Admin
    Post count: 31206

    thanks for sharing! 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket