Support

Account

Home Forums General Issues Best way to use ACF in Artist/Artworks relationship Reply To: Best way to use ACF in Artist/Artworks relationship

  • OK, i guess that $arts = get_field(‘art_artist’); is actually looking at the artist page ID of the original language…

    If i create a custom Query, i can get the Artworks to be listed in French and English :

    I get the actual artist page ID :

    
    if (ICL_LANGUAGE_CODE == 'en'):
        $id_art = get_the_ID();
    
    elseif (ICL_LANGUAGE_CODE == 'fr'):
        $id_art = get_the_ID();
    endif;
    

    Then :

    $args = array(
    				'post_type' => 'artworks',
    				'posts_per_page' => -1,
    				'meta_query' => array(
    					array(
    						'key' => 'art_artist', 
    						'value' =>  $id_art,
    						'compare' => 'LIKE'
    						)
    					)
    				);	
    

    The problem now is that the post listed do not respect the post order that was assigned in the admin…like I mentioned in my reply of June 12, 2019 at 2:38 am.

    Would you have a better solution?

    Thanks in advance!