• 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)
  • 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

    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.ww.wp.xz.cn

Viewing 1 replies (of 1 total)

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