WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to create a grid layout with images, which change daily. So i could build a pool of images in advance for a whole month and the page shows automatically the appropriate image every day. The image could be named after the date or could be connected to this information on another way.

How do i achieve this in wordpress?

I'd appreciate your input.

share|improve this question
up vote 0 down vote accepted

You can put all the related images in a specific directory. Let's say the directory is grid_images and all the images have jpg extension. Then when you want to show the image, you can get the current day of the month and pull the image accordingly.

$image = PATH_TO_GRID_IMAGES_DIRECTORY .  date( 'j' ) . '.jpg';

Once you have the image variable you can use this as per your need.

Note: The images should be named as 1.jpg, 2.jpg, .... , 31.jpg

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.