Title: Post format
Last modified: July 9, 2018

---

# Post format

 *  Resolved [miro83](https://wordpress.org/support/users/miro83/)
 * (@miro83)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/post-format-23/)
 * Hi,
    I need assistance with formatting the HTML output. I managed to load my 
   custom template(copy of default.php). Now, my goal is to add classes of category
   names to each li element in the list. I’m assuming I need to modify line 65 in
   the template.
 * So, what I what to achieve is to have classes in li elements so I can target 
   that elements and style them individually.
 * Thank you for the great plugin.
    -  This topic was modified 7 years, 11 months ago by [miro83](https://wordpress.org/support/users/miro83/).
    -  This topic was modified 7 years, 11 months ago by [miro83](https://wordpress.org/support/users/miro83/).
    -  This topic was modified 7 years, 11 months ago by [miro83](https://wordpress.org/support/users/miro83/).
    -  This topic was modified 7 years, 11 months ago by [miro83](https://wordpress.org/support/users/miro83/).

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

 *  Plugin Contributor [zymeth25](https://wordpress.org/support/users/zymeth25/)
 * (@zymeth25)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/post-format-23/#post-10479471)
 * Try this code:
 *     ```
       //Start a List Item for each post:
       $categories = array_map( function( $cat ) { return $cat->slug; }, get_the_category() );
       $lcp_display_output .= "<li class='" . implode( " ", $categories ) . "'>";
       ```
   
 * Every `li` element will get as many classes as the corresponding post has assigned
   to it.
 *  Thread Starter [miro83](https://wordpress.org/support/users/miro83/)
 * (@miro83)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/post-format-23/#post-10486505)
 * Thank you!

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

The topic ‘Post format’ is closed to new replies.

 * ![](https://ps.w.org/list-category-posts/assets/icon-256x256.png?rev=2517221)
 * [List category posts](https://wordpress.org/plugins/list-category-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/list-category-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/list-category-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/list-category-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/list-category-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/list-category-posts/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [miro83](https://wordpress.org/support/users/miro83/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/post-format-23/#post-10486505)
 * Status: resolved