WAIT: Taxonomies not queried when Query is a relationship

Bricks Version: 1.6.2
Browser: all
OS: Windows
URL: Marlène Ballario – Domini vs Recherche – Domini

Hi, not sure if it’s a bug or if it’s supposed to be like that (I don’t think so)…

I have a template card used on different pages. When the card is used in a simple query loop, the type of listing (which is a taxonomy) appears properly. (for example on this page: Recherche – Domini)

But, when the same card is queried from a relationship, for example here, on the single agent page (to show up their listing) (ex: Marlène Ballario – Domini)
image

the type of listing (the taxonomy) is not pulled

Is it “normal”?!
thanks in advance!

Hi Jo,
Thanks so much for your report!

Which tag do you use within your card to output the taxonomy?
Alternatively, can you test if it works with get_the_terms (in a code block)?

<?php 
    $terms = get_the_terms( $post->ID, 'your-taxonomy-name' );
		foreach($terms as $term) {
      echo $term->name;
    }
?>

Best regards,
timmse

Hi @timmse
it semi-works.
The taxonomy is queried but I get this error (used the code you provided with the id of my taxonomy):

Are you able to spot what it is?
thanks a lot

Add the line global $post; at the beginning of the snippet.

Worked!!! thanks a lot!

Hey Jo,
Please send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase, so I’m able to take a look at your setup in detail and can reproduce the issue if necessary.

This should also work without custom code :slight_smile: