WP Date Image Hack

I am posting the simple hack I made with using dynamic images to replace the date entries of my blog. Just follow the short tutorial here to implement the same with your WordPress blog:

  • Create your own date image template in Photoshop. Make sure that you layout them so that the month, day and year are all distinct from each other and not overlapping. See my example here :
  • Using the ruler guide in Photoshop, slice the template into three parts.
  • You will need to determine the date format you use in your blog. Mine uses day of week, day and month. Now create individual images using the sliced template and name them accordingly. For day of week, the naming convention is mon.gif, tue.gif, … sun.gif; for the day — 1.gif,… 30.gif; for the month — jan.gif, feb.gif,… dec.gif.


  • (Note: If you use full date names, you will need to name your GIF files similarly (i.e. Friday, February 22, 2005 will use “friday.gif”, “february.gif”, “22.gif” and “2005.gif”).
  • Now, we’re ready to hack the WP date function to replace text dates with images. Go to your WP theme folder and look for the post.php file and open it for editing. Note: depending on the WP theme you use, the file could also be index.php.
  • Look for the date function as such:

    You will need to break that into 3 parts like this:



    Now we edit them so the code echos the image equivalent:

    “); ?>
    “); ?>
    “); ?>
  • You will need to check on the date format parameter string if you have a different date format.

I hope that was fairly simple to understand. :D I’m not sure if this hack can be made into a plugin though.

Abe Olandres
Abe Olandres
Abe is the founder and Editor-in-Chief of YugaTech with over 20 years of experience in the technology industry. He is one of the pioneers of blogging in the country and considered by many as the Father of Tech Blogging in the Philippines. He is also a technology consultant, a tech columnist with several national publications, resource speaker and mentor/advisor to several start-up companies.
  1. wow. just as i thought. yeah. im a newbie but i almost exactly figured out what you have done to came up with your wp-image-date Plugins. You really are a PHP guru. Why not submit your plugin?? and share your package to others… ;)

    master i know how to make some tweaks on wordpress but i dont know php itself. :(

  2. cool plug-in!!! did you join Alex King’s contest? :)

    Will install it this week! Great one, Yuga!!! You really deserve all the accolades you have been getting.

  3. Yup it can be made into a plug-in, I think that add_action function in WP…

  4. @mr. nice ash

    tehehe… madali lang yan actually. Konting kalikot lang. ;)

    @AnP

    Thanks! Hindi po, late na ako dun tsaka di ko ata kaya yun!

    @Fleeb

    Will look into it, but this one is pretty simple. Yung magiging problem mo dito cguro yung management ng Options as WP-Admin.

  5. Yuga, you can actually do it without hacking the date functions. You just make do with:

    .gif’ >

    and the others in similar ways. That way, upgrading WP won’t kill your nice hack. :)

  6. Damo gali sagad sa guam bah. Labay lang ko ah.

  7. i agree with markku

  8. Kates, taga diin ka? Ilongga ka man?

    Thanks markku, darksparrow… will look into it. ;)

  9. and the wordpress hacks… sikat na talaga master ko.

  10. Why don’t you just output the text in different spans over a single background image? It really isn’t *standard* anymore to use images for anything that could be displayed with text (like the “Too Cool for IE” badge)

Leave a Reply

Your email address will not be published. Required fields are marked *

yugatech x epson

Latest Review

HUAWEI FreeArc Review – Great sounding Open-Ear wireless earphones
Lenovo Idea Tab Pro Review
vivo V50 5G Review
OPPO Find N5 Review
realme 14 Pro+ 5G Review

Latest Guide

A Look Inside Grab’s IoT Innovations at Grab HQ After GrabX2025
Top 10 AFFORDABLE 65-inch 4K TVs To Buy In The Philippines (Q1 2025)
BEV, Hybrid, PHEV: An Explainer for the Common Filipino Driver
2025 Postpaid Fiber Plans in the Philippines: PLDT, Globe, Converge, Sky
Top Apple products to kickstart the New Year through Home Credit

YugaAuto

Loading feed...

YugaMoto

Loading feed...

YugaGaming

Loading feed...

AskYuga

Loading feed...
WP Date Image Hack » YugaTech | Philippines Tech News & Reviews

Yearly Device Database

Smartphone pricelist Philippines 2024

Smartphone pricelist Philippines 2023

Smartphone pricelist Philippines 2022

Smartphone pricelist Philippines 2021

Smartphone pricelist Philippines 2020

Popular Topics

What We Do

YugaTech | Philippines Tech News & Reviews
© 2024. All Rights Reserved.