WordPress.org

Ready to get started?Download WordPress

Forums

Querying custom post type with two criteria (1 post)

  1. goofydg1
    Member
    Posted 1 year ago #

    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);

Topic Closed

This topic has been closed to new replies.

About this Topic