Support » Themes and Templates » Day of the Week Image Plugin/CSS Trick Needed

  • Is there a plugin or some kind of CSS trick that I can implement that will show an image wrapped within the text of my blog entry depending on the day of the week.

    For example, if I publish something on Thursday, I would like a little graphic that says “Thursday” at the beginning of the blog entry with the entry text wrapped around it. I’ve seen it on EE blogs, but can’t find anything like that for WP.

    Ideally, it would only show up on the most current entry for the day.

    I guess it would be similar to the old category icon plugins but dependent on the date, not category.


Viewing 7 replies - 1 through 7 (of 7 total)
  • One possible way would be to make 7 graphic files (one for each day) and insert them as you write each entry.

    You would also need some CSS that would center the images within the content tag.

    Thanks. I hadn’t even thought of that. Although, if I only wanted it to show up on the most recent post for that day, I’d have to edit any older posts made that day, right?

    That might be too bad though.

    Thanks for the help. 🙂

    Check out my site (click ‘pizzaman’). I have a thingy that I swiped from a theme somewhere that looks like a daily calendar page. It’s done using text (no graphics) and CSS. It could be placed at the beginning of each entry with text wrapping around it. I can post the code if you like.

    the_date will only output (normally) when the date changes. So if you change your date format to be the day-of-week only (and not other parts), you are most of the way there.

    if you want it more ‘graphical’ without using actual graphics, there’s a ton you can do in CSS. you can also use something like CG-FlashyTitles or coldforged’s graphic headlines to transform the day text into something a little more ‘standout’.


    Yes, davidchait is correct. All you need is the_date() function using just the day as the arguement.

    the_date('D'); <- would give you the 3 letter abbreviated day
    the_date('l')); <- would give you the full day name (lowercase L)

    Thanks you guys. I’ve tried using the coldforged headlines plugin… and I really like it… it’s perfect! EXCEPT, I can’t figure out how to make it work for the date.

    It works fine for the title so I know it’s not the plugin. Should I just be adding -image- to the the_date(‘-image-‘) ???

    Other way around Angela, the image tag should be outside ‘the_date’ or ‘the_time’ tags. I know this is an old thread, but I was searching through for the answer and had to cobble it together myself, figure I’d post here to help.

    If you want an image to show up to the right of your header, make a call like this:

    <div class="<?php the_time('l') ?>"></div>
    <h2 class="title">whatever</h2>

    The css should look like this:

    .Sunday { position: relative; left:-5px; top:54px; width: 30px; height:35px; background: url(/images/h2/sun.gif) no-repeat; }

    If your post occurs on a Sunday, the php script will insert “Sunday” where it makes “the_time” call. What the browser will see is this:

    <div id="Sunday"></div><h2 class="title">whatever</h2>

    When that happens, the css script will insert the image you defined to show on sunday posts. Check my website for an example, I use japanese characters for each day of the week.

    You’ll notice that I also say the day of the week and date after my title, that can be done through the following:

    <?php the_time('l - F jS, Y') ?>

    The ‘l’ (lowercase L) is the day of week. I do this for those who can’t read japanese… The reason you want a ‘class’ tag instead of a ‘id’ tag is incase you have a long archive with multiple of the same day called on the same page. That is a valid XHTML no-no.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Day of the Week Image Plugin/CSS Trick Needed’ is closed to new replies.