Title: Sidebar changes with Date
Last modified: August 18, 2016

---

# Sidebar changes with Date

 *  [tfleming](https://wordpress.org/support/users/tfleming/)
 * (@tfleming)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/sidebar-changes-with-date/)
 * I’d like to code for different sidebars that are displayed based on the date.
   On Monday, sidebar A shows up; on Tuesday, sidebar B shows up, etc. Then (and
   this might be asking too much), if someone click the Monday archive, sidebar 
   A shows up again.
 * Any help on this would be greatly appreciated!

Viewing 1 replies (of 1 total)

 *  [Adam Brown](https://wordpress.org/support/users/adamrbrown/)
 * (@adamrbrown)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/sidebar-changes-with-date/#post-635286)
 * You would have to do most of the coding on this, obviously, so I’m assuming you’re
   fairly comfortable in PHP.
 * To get you started, look at this: [http://php.net/date](http://php.net/date)
 * You want option ‘w’. Something like this:
 *     ```
       if (0==date('w')){
         put code here for sunday sidebar
       }elseif (1==date('w')){
         code for monday
       }elseif...
       ```
   
 * Or use a switch instead of if…elseif. MIght be cleaner, but the result is the
   same. That would show different sidebars each day. Same logic for the archive
   thing, but I’d have to look in the codex to see how to check whether they’re 
   on the monday archive. Codex: [http://codex.wordpress.org](http://codex.wordpress.org)

Viewing 1 replies (of 1 total)

The topic ‘Sidebar changes with Date’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Adam Brown](https://wordpress.org/support/users/adamrbrown/)
 * Last activity: [18 years, 8 months ago](https://wordpress.org/support/topic/sidebar-changes-with-date/#post-635286)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
