Home Forums General Issues Querying relationship fields Reply To: Querying relationship fields

  • Yes, I am aware that I need to put the relationship code within my loop but I don’t know what the code should be. Every time I tried adding it, I got a php error. I’m confused because I’m already querying multiple different posts on the page (unlike the documentation which shows an example of querying for a single template file).

    Please see the screenshots for what I’m working with. I know this is slightly complicated but I’m sure folks would want to know how to do this as well.

    I want to query the image somewhere between this div.

    <a href="<?php the_permalink() ?>" title="<?php printf(__('%s','rys'), get_the_title()) ?>" rel="bookmark" ><?php the_title(); ?></a>
    		<em><?php the_field('publication_source'); ?></em>
    <span><?php $date = get_field('publication_date');
    			echo date('F d, Y', datepicker_to_unix($date )); ?></span>

    Really appreciate your help! Thank you!!