Support » Fixing WordPress » Querying custom post type with two criteria

  • Thanks in advance for any help.
    I’ve created a page that lists the taxonomy of a custom-post-type. The issue I’m running into is I’ve created a page that should only pull the category and a placement code (in the example that’s standard). It’s pulling the placement but how do I get it to add in the dynamically created category pulled from the previous page.

    Code that dynamically pulls taxonomy (category header). This pulls the right category on the page.
    $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); echo $term->name;

    Code below that pulls on the particular placement. How do I add the dynamically pulled taxonomy pulled by code above so content meets both criteria.

    $args = array(
    	'post_type' => 'buyersguide',
        'meta_query' => array(
            array(
                'key' => 'Placement',
                'value' => 'standard',
                'compare' => 'LIKE'
            )
        )
    );
    query_posts($args);
  • The topic ‘Querying custom post type with two criteria’ is closed to new replies.