Displaying Related Posts
-
Thank you for such a wonderful plugin! It’s amazing how powerful it is.
I do have a question on how to display relating posts.
I have created a custom field for my standard wordpress post type, called relationship. This is a relationship field that links to a post in a custom content type.
My question is, how do I display a list of related posts (from my standard wordpress type) on my custom content type template?
I’m guessing it’s something like this, but need some guidance here.
<?php
$my_array = get_custom_field(‘relationship:to_array’);
foreach ($my_array as $item) {
print $item;
}
?>Essentially what I have is many posts that relate to a single race, i’d like to list all posts that relate to a race when viewing a race page..
I hope that is clear.
- The topic ‘Displaying Related Posts’ is closed to new replies.