admin管理员组

文章数量:1418096

I have a custom post type called ring_advantage.

I have a custom taxonomy on ring_advantage, called issue_RingAdvantage

I have a custom taxonomy on ring_advantage called topic

I write an article under ring_advantage, pick an issue from issue_RingAdvantage, and pick a topic.

On the front-end, the user can land on a page that displays the information about issue_RingAdvantage (title, image, etc). On that same page, I want to display all articles that match the currently viewed issue_RingAdvantage AND the topic of the ring_advantage article.

I have the following query which successfully pulls in the articles attached to issue_RingAdvantage, but doesn't show the topics of the articles:

$current = get_terms(
    array(
        'taxonomy'      =>  'issue_RingAdvantage',
        'hide_empty'    =>  false,
        'orderby' => 'ID',
        'order' => 'DESC',
        'number' => 1
    )
);

$args = array(
    'post_type' =>  'ring_advantage',
    'tax_query' =>  array(
        array(
            'taxonomy'  => 'issue_RingAdvantage',
            'field'     => 'slug',
            'terms'     => $current[0]->slug,
        ),
    ),
);

How can I implement a query that ALSO gets the topic associated with ring_advantage?

本文标签: functionsQuery taxonomy of taxonomy of custom post type