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.

Is there a plugin that will allow me to do the above?

Basically I have a webcomic that updates twice a week with two different stories. http://www.lunarblade.com What I would like to be able to do is have it somehow automatically use image A for Tuesdays that'll tell people there's a new page of story A, and image B on Thursdays to show there's a new page of story B.

So if anyone knows a solution, via plugin or scripts (I'm a novice scripter of CSS), I would be very appreciative. I would love to find something that sets a specific image for a specific day. Thank you for your time reading this!

Anat.

share|improve this question
1  
That's quite a specific request. FYI, plugins recommendation is off-topic, as well as pure CSS questions. I really doubt something like this exists as a plugin or as snippet somewhere in the interwebs (CodeCanyon, maybe...). IMO, for anyone here to answer this would mean developing a full blown plugin. :::: I suggest you to reduce the scope (edit the question) to a code that swaps images in given days. After that, the kicker would be another question. –  brasofilo Nov 28 '12 at 22:36
    
Thank you very much for your answer. I have taken your advice and edited the question above. Let's see if perhaps anyone knows of a plugin that simply allows certain images to be associate with specific days! –  Anat Nov 28 '12 at 23:37
1  
Plugin recommendations are off topic here. We collect solutions, not links. :) –  toscho Nov 28 '12 at 23:41

1 Answer 1

Unless i missunderstood you,
This should be easy to do without using a plugin...

Embed this in your functions.php:

function echoDayImage() {
    // GET CURRENT DAY
    $currentDay = get_the_time('l');

    // CHECK DAY AND ECHO SUITABLE IMAGE
    if($currentDay = 'Sunday') {echo TEMPLATEPATH.'/images/Sunday.jpg';}
    elseif($currentDay = 'Monday') {echo TEMPLATEPATH.'/images/Monday.jpg';}
    elseif($currentDay = 'Tuesday') {echo TEMPLATEPATH.'/images/Tuesday.jpg';}
    elseif($currentDay = 'Wednesday') {echo TEMPLATEPATH.'/images/Wednesday.jpg';}
    elseif($currentDay = 'Thursday') {echo TEMPLATEPATH.'/images/Thursday.jpg';}
    elseif($currentDay = 'Friday') {echo TEMPLATEPATH.'/images/Friday.jpg';}
    elseif($currentDay = 'Saturday') {echo TEMPLATEPATH.'/images/Saturday.jpg';}
}

Then in the location you wish to use it just use the function:

<?php echoDayImage(); ?>

(learn more about formatting date / time here: Customizing the Time and Date)

EDIT 1 (for comment explenation)

function echoDayImage() {
    // GET CURRENT DAY
    $currentDay = get_the_time('l');
    echo TEMPLATEPATH.'/images/days/'.$currentDay;
}
share|improve this answer
    
+1 --> for this will work, hence is helpful to the OP and totally correct. That being said and done, allow me to say the following: 1. Why not simply use date('w') to grab the current day as an integer from 0 (Sunday) to 6? 2. In case you have never read them and are interested, you might want to take a look at the WP Coding Standards, camelCase isn't exactly common usage. Don't get me wrong, I don't mean to sneer at your answer, this is simply friendly advice. :) –  Johannes Pille Nov 29 '12 at 7:05
    
thanks mate - i tried using days because... well if it was me i would skip the whole if - else and just get the image of the day using the returned value (see edit 1 in my answer) but i wanted to make this answer readable... as for the string having a first capital letter see the first part of this explanation :) - in any case thanks for the tips & the input –  Sagive SEO Nov 29 '12 at 18:38
    
Agreed, the edit is much simpler. If I wouldn't have upvoted this already, you'd have my upvote now. –  Johannes Pille Nov 29 '12 at 20:23

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.