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!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.