Title: How to: switch between CSS classes?
Last modified: August 19, 2016

---

# How to: switch between CSS classes?

 *  [thealchemyst](https://wordpress.org/support/users/thealchemyst/)
 * (@thealchemyst)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/how-to-switch-between-css-classes/)
 * I’m still a WP newbie and I have this issue: I want to list my posts in two columns.
   Both are using CSS class (“list-story” and “list-story-alt”) so is there some
   WP tag where I could just switch dynamically those CSS classes?
 * This is how I want to present:
 *     ```
       <div class="list-story">
       Story info
       </div>
   
       <div class="list-story-alt">
       Story info
       </div>
   
       <div class="list-story">
       Story info
       </div>
   
       ...
       ```
   
 * Any tips?

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

 *  [iridiax](https://wordpress.org/support/users/iridiax/)
 * (@iridiax)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/how-to-switch-between-css-classes/#post-911892)
 * You need to alter more than the css to list your posts in columns. Try a forum
   search to see how others accomplished it:
 * [http://wordpress.org/search/posts+columns?forums=1](http://wordpress.org/search/posts+columns?forums=1)
 *  Thread Starter [thealchemyst](https://wordpress.org/support/users/thealchemyst/)
 * (@thealchemyst)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/how-to-switch-between-css-classes/#post-911921)
 * I thought there is a simple method for it. For example in ExpressionEngine there
   is a “switch” method where you can basically do this:
 * <div class=”{switch=’list-story|list-story-alt’}”></div>
 * And you get alternate DIVs.
 * Can WordPress accomplish it with this kind of manner or it needs some deeper 
   hacks?

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

The topic ‘How to: switch between CSS classes?’ is closed to new replies.

## Tags

 * [Alternate](https://wordpress.org/support/topic-tag/alternate/)
 * [Howto](https://wordpress.org/support/topic-tag/howto/)
 * [switch](https://wordpress.org/support/topic-tag/switch/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [thealchemyst](https://wordpress.org/support/users/thealchemyst/)
 * Last activity: [17 years, 6 months ago](https://wordpress.org/support/topic/how-to-switch-between-css-classes/#post-911921)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
