Support

Account

Home Forums General Issues Get posts with Relationship Query Reply To: Get posts with Relationship Query

  • Do you mean how to get the ID or the title of the artist of the current post from the relationship field instead of using a hard coded name like in your example ‘natasha_yudina’ or you want to show only post from ‘natasha_yudina’?

    Either way you are using compare the wrong way I guess. This is purely a wordpress question.

    Change this:

    array(
            'key' => 'artist', // name of custom field
    	'value' => 'name', // matches exaclty "123", not just 123.This prevents a match for "1234" 
    			'compare' => 'natasha_yudina'
    		)

    To this:

    array(
           'key' => 'artist', // name of custom field
            'value' => 'natasha_yudina' // value of custom field
            )