Hi. I am trying to pull in the posts that I request in a custom field as related titles. I’m directly editing my templates.
Example: Custom field “relatedposts” has input of “105, 107, 108, 112”
These are the IDs of 4 posts that I want to display the titles of, underneath my post.
So far (in index.php) I have this:
$post_id = 105;
$queried_post = get_post($post_id);
<h3><?php echo $queried_post->post_title; ?></h3>
This works but obviously doesn’t pull in the array set by the custom field. I’m not too hot on arrays, how can I achieve this?
Thanks in advance.
- The topic ‘Pull in post numbers from Custom Fields’ is closed to new replies.