Get Connections from a post, outside of the loop
-
Hi,
I’m using PolyLang and Post-to-post.
In a post, the default language (English) contains all the connections, it works fine on the English language. However, It won’t get the connections for different language (as the connections are not mapped in the admin).The problem is that I have many connections, and I want to keep the connections in-sync with the languages.
I tried the followings to resolve this:
When the post is in a different language (other than default English), it gets the connection from it’s English post, and display the connections.Code:
$beauty_connected = new WP_Query( array( 'p' => $translated_id, 'post_id'=>$translated_id, 'connected_type' => 'stores_to_beauty_brands', 'connected_items' => get_queried_object(), 'orderby' => 'title', 'order' => 'asc', 'nopaging' => true, ) );
$translated_id is the post_id of the English post. However I still get nothing from the query. This works when I’m in the English post.
Can someone tell me what I should do please?
Thank you.
- The topic ‘Get Connections from a post, outside of the loop’ is closed to new replies.