Title: Unordered List Category with PHP
Last modified: August 30, 2016

---

# Unordered List Category with PHP

 *  Resolved [rmez](https://wordpress.org/support/users/rmez/)
 * (@rmez)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/unordered-list-category-with-php/)
 * I’m working on a site and would like to incorporate all the posts from a category
   in the left side menu bar. [http://earthlit.com/](http://earthlit.com/)
 * I managed to get them in place with a line of php code in sidebar.php.
 * _Line of code being used: <?php wp\_get\_archives( array( ‘type’ => ‘postbypost’,‘
   limit’ => 30, ‘format’ => ‘custom’ ) ); ?>_
 * But I need to have the list to have one post per line like an unordered list.
 * Could someone help me figure out what I need to do?

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/unordered-list-category-with-php/#post-6222222)
 * try to incorparate the `'before'` and `'after'` parameters as described in the
   Codex [https://codex.wordpress.org/Function_Reference/wp_get_archives](https://codex.wordpress.org/Function_Reference/wp_get_archives);
 * example:
 * `<ul><?php wp_get_archives( array( 'type' => 'postbypost', 'limit' => 30, 'format'
   => 'custom', 'before' => '<li>', 'after' => '</li>' ) ); ?></ul>`
 *  Thread Starter [rmez](https://wordpress.org/support/users/rmez/)
 * (@rmez)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/unordered-list-category-with-php/#post-6222397)
 * [@alchymyth](https://wordpress.org/support/users/alchymyth/)
 * Thank you so much! That did the trick and made my client very very happy. I apologize
   I didn’t reply to you sooner. All the best to you!

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

The topic ‘Unordered List Category with PHP’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [Coding](https://wordpress.org/support/topic-tag/coding/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)
 * [Sidebar Menu](https://wordpress.org/support/topic-tag/sidebar-menu/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [rmez](https://wordpress.org/support/users/rmez/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/unordered-list-category-with-php/#post-6222397)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
