Title: &#8220;Recent Posts&#8221; custom code
Last modified: August 18, 2016

---

# “Recent Posts” custom code

 *  [hotdiggity](https://wordpress.org/support/users/hotdiggity/)
 * (@hotdiggity)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/recent-posts-custom-code/)
 * I’d like to add more pages that the ‘Recent posts’ appear on in sidebar…’is_archive’,
   etc, etc. ie all pages except the front (home) page!!
 * Currently code is:
 * <?php if (is_page() || is_single()) { ?>
    -  <h2>Recent Posts</h2>
       <ul class=”recentposts”> <?php get_archives(‘postbypost’,’
      10’,’custom’,’
    - ‘,’
    - ‘); ?>
    - <?php } ?>

Viewing 1 replies (of 1 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/recent-posts-custom-code/#post-462478)
 * “_all pages except the front (home) page_“
 * `<?php if ( !is_home() ) { ?>`
 * In PHP lingo, ! = not.

Viewing 1 replies (of 1 total)

The topic ‘“Recent Posts” custom code’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * Last activity: [19 years, 7 months ago](https://wordpress.org/support/topic/recent-posts-custom-code/#post-462478)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
