Title: Customing code within dynamic sidebar widget
Last modified: August 19, 2016

---

# Customing code within dynamic sidebar widget

 *  [swortis](https://wordpress.org/support/users/swortis/)
 * (@swortis)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/customing-code-within-dynamic-sidebar-widget/)
 * I would like to customize the code of posts listed in a dynamic sidebar. I know
   this is likely super easy but I’m lost.
 * I can change parameters of the widget in the functions.php file in my theme:
 * register_sidebar( array(
    ‘name’ => __( ‘Primary Widget Area’, ‘theme’ ), ‘id’
   => ‘primary-widget-area’, ‘description’ => __( ‘The primary widget area’, ‘theme’),‘
   before_widget’ => ‘<li id=”%1$s” class=”widget-container %2$s”>’, ‘after_widget’
   => ”, ‘before_title’ => ‘<h2 class=”widget-title”>’, ‘after_title’ => ‘</h2>’,));
 * But I’m unsure on how to add the class ‘post’ to the individual
    `<li>`‘s within
   that widget. _[mod: please use the code button or backticks to mark code]_
 * Thanks in advance!

Viewing 1 replies (of 1 total)

 *  Thread Starter [swortis](https://wordpress.org/support/users/swortis/)
 * (@swortis)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/customing-code-within-dynamic-sidebar-widget/#post-1900615)
 * “But I’m unsure on how to add the class ‘post’ to the individual
    li’s within
   that widget.”
 * (the tag was stripped out)

Viewing 1 replies (of 1 total)

The topic ‘Customing code within dynamic sidebar widget’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [swortis](https://wordpress.org/support/users/swortis/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/customing-code-within-dynamic-sidebar-widget/#post-1900615)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
