Title: display one post inside another? single.php loop
Last modified: August 19, 2016

---

# display one post inside another? single.php loop

 *  Resolved [TinyMonster](https://wordpress.org/support/users/tinymonster/)
 * (@tinymonster)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/display-one-post-inside-another-singlephp-loop/)
 * Hi this is my third attempt to post this, as my other 2 posts seem to have been
   deleted. Maybe they were in the wrong category?
 * I am trying to use the loop to show the content and extra field values of one
   post inside another post using an extra field to specify the ID of the post I
   want to include.
    I can figure out the extra field bit’s but can’t get the loop
   to show the content of the other post.
 * So inside my single.php I am adding the following if statement below where the_content
   etc:
 * <?
    $otherPostID = get_post_meta($post->ID, otherPostID, true); if ($otherPostID){?
   >
 * show loop here and get the ID of the post to include from $otherPostID
 * <? } ?>
 * The if statement works fine if I add an id number to my extra field, I just can’t
   seem to manipulate the loop to get a specific posts content.
    I have looked through
   the forum and can only seem to find solutions to list posts on archive pages
 * Any help would be much appreciated.
 * Mr M

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/display-one-post-inside-another-singlephp-loop/#post-1765437)
 * [http://codex.wordpress.org/Function_Reference/get_posts](http://codex.wordpress.org/Function_Reference/get_posts)
 *  Thread Starter [TinyMonster](https://wordpress.org/support/users/tinymonster/)
 * (@tinymonster)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/display-one-post-inside-another-singlephp-loop/#post-1765555)
 * Thanks 🙂
 * I did work through that and couldn’t figure it out. I have now though, after 
   a 2nd look. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘display one post inside another? single.php loop’ is closed to new replies.

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [single.php](https://wordpress.org/support/topic-tag/single-php/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [TinyMonster](https://wordpress.org/support/users/tinymonster/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/display-one-post-inside-another-singlephp-loop/#post-1765555)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
