Filtering info from one PODS CPT with a Relationship field to other PODS CPT

Building a website for a cleaning services company, I’m struggling to filter the FAQs that are related to each Cleaning Service.

Let me explain:

  • Site built with WordPress 6.4.3 running Bricks Child Theme theme. Bricks v1.9.5 + PODS v3.0.10
  • Created 2 CPTs with PODS: 1) Cleaning Services (slug=cleaning_service) and 2) FAQ (slug=faq), each having a Bidirectional Relationship field linked to the other (name=related_faq on the Services and name=related_cleaning_service on the FAQ) + a custom taxonomy for Type of Service (Residential, Commercial, Operational) (slug=type_of_service) which is connected to both CPTs.
  • Problem to solve: generate the Taxonomy Query to filter on the single post template for each Cleaning Service, all the FAQs that are related to that service.

Any suggestion to solve the problem will be greatly appreciated.
In case it cannot be done using PODS Relationship fields, how would you do it?

I have used these tutorial : Adding any Custom WP_Query loop to Bricks' Query Loop - BricksLabs

And in the "Setup post data for posts " part, I have edited my query like that:

function run_new_query() {
  $current_post_id = get_the_ID();
  $pod = pods( 'NAME_OF_PODS', $current_post_id );
  $related = $pod->field( 'NAME_OF_THE_RELATIONSHIP_FIELD' );
  $related_ids = [];

  foreach ( $related as $related_post ) {
    $related_ids[] = $related_post["ID"];
  if ( empty( $related_ids ) ) {
    // No data in relationship field
    $args = [
      'post_type' => 'NAME_OF_PODS',
      'posts_per_page' => 2,
      'post__not_in' => [ $current_post_id ],
      'orderby' => 'rand',
  } else {
    // Data in Relationship field
    $args = [
      'post_type' => 'NAME_OF_PODS',
      'post__in' => $related_ids,
      'posts_per_page' => 2,
    $posts_query = new WP_Query( $args );

    return $posts_query->posts;


Don’t know if it helps… But working great for me :wink:

Sebastien, thank you so much for your response. I will look into it and post back with results.

Unfortunately I am allergic to coding, but I guess I would have to take some medicine for this. I am very new to Bricks and I also understand the product is still growing strong! I am getting to love it! Our first website was up in 1995 and come with 12 years of WordPress, 6 years of Elementor and 2 weeks of Bricks! :slight_smile:

I am going to have to start by learning where to place the code and what to change to make it work.