Support › MB Relationships › Displaying connected content on post archive not working anymore
I have connected content that used to display on post archived using this code from the docs:
global $wp_query, $post;
'id' => 'posts_to_pages',
'from' => $wp_query->posts, // 'from' or 'to'.
while ( have_posts() ) : the_post();
// Display connected pages
foreach ( $post->connected as $p ) :
// More core here...
For some reason, it's not displaying anything anymore.
As you can see, the array is empty:
But there are two books connected to the series:
Here is a look at my code:
Let me know if you have any idea what is going on and why it suddenly stopped working.
I also test the static function each_connected() on my demo site and see it does not work. Please use the function get_connected() to fix this issue. Following the documentation
I have fixed the issue with get_connected().
If each_connected() starts working again, I'd love to use that again since I'm using it on a post archive.