• Hi,

    When running a query using connected_type, connected_items, connected_direction, etc., is there a way to narrow down the posts that Posts 2 Posts returned to such posts which are tagged with one or more specific terms from a custom taxonomy?

    Essentially what I’m looking for is a tax_query functionality that applies to the connected posts.

    Something like the following (see the connected_tax_query) would be ideal, but I haven’t found a way to achieve this yet:

    $posts = get_posts(array(
      'post_type' => 'post_type_a',
      'connected_type' => 'post_type_b',
      'connected_items' => $list_of_narrowed_down_candidates,
      'connected_direction' => 'to',
      'connected_tax_query => array( etc. ),
      'nopaging' => true,
      'suppress_filters' => false
    ));

    Is this possible, or what would be the best way to implement this?

    https://wordpress.org/plugins/posts-to-posts/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter AngryGerman

    (@angrygerman)

    Ah, I believe I found what I was looking for.

    Is it correct to assume that using connected_query with a tax_query inside of that will do exactly this?

    Hi,

    Did this end up working?

    I am trying to query a custom meta field value from a connected post type.

    I have recipes and ingredients CPTs with a p2p connection type recipes_to_ingredients. I can successfully query and list all connected ingredients, but i can’t figure out how to simply display a meta key/value as well.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Taxonomy Query Possible?’ is closed to new replies.