WordPress.org

Ready to get started?Download WordPress

Forums

Query custom post type & custom taxonomy not working! (1 post)

  1. lsatdown
    Member
    Posted 3 years ago #

    I have a custom post type 'promotion' which is linked to a custom taxonomy type of 'promotions-cat'. I've added 'cat1' as a category in this taxonomy.

    I'm trying to query this post type and query the category, which is not returning any results:

    $query = 'post_type=promotion&';
    $query .= 'posts_per_page=-1&';
    $query .= 'post_status=publish&';
    $query .= 'category_name=cat1&';
    $query .= 'orderby=date&';
    $query .= 'order=DESC';
    
    $news_list = new WP_Query();
    $news_list->query($query);

    Tried this too but not working :(
    $query .= 'cat=$post-cat_ID&';

Topic Closed

This topic has been closed to new replies.

About this Topic