Title: Adding elements via sidebar.php template
Last modified: August 18, 2016

---

# Adding elements via sidebar.php template

 *  [richards1052](https://wordpress.org/support/users/richards1052/)
 * (@richards1052)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/adding-elements-via-sidebarphp-template/)
 * I’m familiar with blogger.com & Typepad templates, but I’m new to WP templates.
   I want to make sure not to screw things up as I add items like Amazon & Google
   ads.
 * Below, you’ll find the beginning of my sidebar template code. If I want to add
   an item before Archives or before
    Recent Entries (for example) where should 
   they go?
 * `</div>`
 * <div id="sidebar">
 * <ul>
    <?php wp_list_pages('title_li=<h2>' . __('Pages') . '</h2>' ); ?> <!-- 
   <li> <h2><?php /*_e('Archives'); */?></h2>
 * <ul>
    <?php /* wp_get_archives('type=monthly'); */ ?> </ul> </li> -->
 * <li>
    <h2><?php _e('Archives'); ?></h2>
 * <ul>
    <?php wp_list_cats(); ?> </ul> </li> <li> <h2>Recent Entries</h2>
 * <ul>
    <?php $posts = get_posts('numberposts=10');
 *  foreach ($posts as $post) :
 *  start_wp();
 *  ?>

The topic ‘Adding elements via sidebar.php template’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [richards1052](https://wordpress.org/support/users/richards1052/)
 * Last activity: [20 years, 12 months ago](https://wordpress.org/support/topic/adding-elements-via-sidebarphp-template/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
