treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Images changing relating to date – Wordpress/PHP

  • I'm new both to php and also wordpress so please excuse me if this is a simple problem.

    I'm hoping to create a blog with dates being the emphasis (please see image). I'm just not sure how to create the php that will call in an image that will relate to a date (not sure if that is the right way to go about it). I want to create 31 images that will relate to the specific day in the month (but not in order).

    I hope this isn't a mental request and I really appreciate any help.

    Regards,

    Rob

    http://robertfarrelly.com/blog_image.jpg
    http://www.robertfarrelly.com/wordpress/index.php
  • The following will not be proper code, but just to give you an idea:

    $numberday = wp_super_date_thing('parameters to only show the day's number');

    Then, in the loop where ever you're displaying this day:

    <img alt="$numberday" class="youprobablyhaveaclass" src="images/my-image-$numberday.jpg" />

    Then all would have to do is name each image my-image-1.jpg, my-image-2.jpg, etc...