Title: pixys's Replies | WordPress.org

---

# pixys

  [  ](https://wordpress.org/support/users/pixys/)

 *   [Profile](https://wordpress.org/support/users/pixys/)
 *   [Topics Started](https://wordpress.org/support/users/pixys/topics/)
 *   [Replies Created](https://wordpress.org/support/users/pixys/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/pixys/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/pixys/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/pixys/engagements/)
 *   [Favorites](https://wordpress.org/support/users/pixys/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Display Posts - Easy lists, grids, navigation, and more] How to add “current-list-item” class to post list for custom styling](https://wordpress.org/support/topic/how-to-add-current-list-item-class-to-post-list-for-custom-styling/)
 *  [pixys](https://wordpress.org/support/users/pixys/)
 * (@pixys)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/how-to-add-current-list-item-class-to-post-list-for-custom-styling/#post-12065360)
 * Hi there,
 * I wish to do the same thing than adubwood(@adubwood) does above. So I tried to
   use the snippet Bill’s kindly provided : I downloaded Code Snippets plugin and
   pasted the piece of code inside. So far so good but…
 * As I can hardly understand php syntax, I’m unable to make the code fit to my 
   own requirements and that’s doesn’t work… Yep, I’m more on the design side, comfortable
   with HTML and CSS but not at all with any code 🙂
 * This is the loop used to retrieve the posts :
 *  `<ul>
 *  <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
 *  <li class=”post-list-item”>
 *  <a href=”<?php the_permalink(); ?>”><?php get_the_title() ? the_title() : the_ID();?
   ></a>
 *  <?php if ( $instance[‘show_date’] ) : ?>
    <span class=”post-date”><?php echo
   get_the_date(); ?></span> <?php endif; ?> </li>
 *  <?php endwhile; ?>
 *  </ul>`
 * The <li class=”post-list-item”> is the one I want to add a “my_current” class
   when the post’s title matches the list-item in my menu.
 * I hope I made myself clear, many thanks if you can help, feel free to ask for
   more infos if needed !
    -  This reply was modified 6 years, 7 months ago by [pixys](https://wordpress.org/support/users/pixys/).

Viewing 1 replies (of 1 total)