WordPress.org

Ready to get started?Download WordPress

Forums

How to change sidebar based on the day (2 posts)

  1. magest
    Member
    Posted 1 year ago #

    Ok, so pretty much theres something i want to put in for every day of the week on my sidebar, for example: monday (pizza) , tuesday (burgers), etc. It will be the same every week, but i don't want to change it everyday. Is there a way where it can automatically change everyday without me having to change it manually?

    I was looking into this, but it only talks about images

    http://wordpress.org/support/topic/rotating-header-images-based-on-time-of-day

    Would there be anyway of doing this? I would appreciate it dearly.

  2. satty005
    Member
    Posted 1 year ago #

    i have checked the code it tells about rotating header images based on time and day in the given link and with moderate changes it will work with the text instead of just images.while you need to include this code in sidebar.php. all you need to do is ommit the code from $newquery= new WP_Query('p=162'); till the end and instead of that add-> echo $dayvar.'('.$text.')'; where $text is a variable that is set in the switch case statement with say all the food items you want to display. and it will give you above result monday(pizza),tuesday(burgers) etc.
    i hope this works for u. good luck

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.