Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
    
What have you tried so far? Please show your code and/or research. –  Brad Dalton Jun 3 at 9:59

1 Answer 1

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

 
discard

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.