Title: Insert post within another
Last modified: August 19, 2016

---

# Insert post within another

 *  Resolved [mrtoner](https://wordpress.org/support/users/mrtoner/)
 * (@mrtoner)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/insert-post-within-another/)
 * Before I get in over my head, could someone point me in the right direction? 
   When viewing a single post in category A, I want another post from category B
   inserted at the end. The category B post will be the most recent of all the category
   B posts and will be only an excerpt of that post, with a “read more” link to 
   the full post.
 * TIA!

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/insert-post-within-another/#post-1088457)
 * So do a get_posts loop in your single.php after the loop that displays the single
   post.
 * One example to consider:
    [http://www.daobydesign.com/blog/2007/07/modifying-wordpress-front-page/](http://www.daobydesign.com/blog/2007/07/modifying-wordpress-front-page/)
 *  Thread Starter [mrtoner](https://wordpress.org/support/users/mrtoner/)
 * (@mrtoner)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/insert-post-within-another/#post-1088480)
 * Thanks, Michael, it wasn’t so hard after all:
 *     ```
       <?php
       if (in_category(array('resources','news'))) :
         $postslist = get_posts('category_name=recommends&numberposts=1&order=DESC&orderby=date');
         foreach ($postslist as $post) :
           setup_postdata($post);
         ?>
       <div>
       <br /><br />
       <h4>Not free, but worth it...</h4>
       <?php the_excerpt(); ?> <a href="<?php the_permalink(); ?>">Read more »</a>
       </div>
       <?php endforeach; ?>
       <?php endif; ?>
       ```
   

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

The topic ‘Insert post within another’ is closed to new replies.

## Tags

 * [How Do I](https://wordpress.org/support/topic-tag/how-do-i/)

 * 2 replies
 * 2 participants
 * Last reply from: [mrtoner](https://wordpress.org/support/users/mrtoner/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/insert-post-within-another/#post-1088480)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
