Home Forums General Issues Get terms of relationship field


Get terms of relationship field

  • Starting from this example

    If doctors had taxonomies as I could from location find all the taxonomies of the doctors who has relationship

  • This should work and do what I want, but it does not work. Someone to help ?? I do not know where I’m going wrong.

    $args = array(
    	'taxonomy' => 'custom_taxonomy',
    	'orderby' => 'name',
    	'order' => 'ASC',
    	'meta_query' => array(
    			'key' => 'my_custom_field', // name of custom field
    			'value' => "{$post_id}", // matches exactly "123", not just 123. This prevents a match for "1234"
    			'compare' => 'LIKE'
    	$atv = get_terms($args);
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Get terms of relationship field’ is closed to new replies.