Apr
06

Customize Date Image

Customize Date Image

You can place your own image for Wordpress Date instead of one already available in the theme. Follow the instruction below:

  1. Create your own date image template in Photoshop.
  2. Using the ruler guide in Photoshop, slice the template into three parts.
  3. You will need to determine the date format you use in your blog.
  4. 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.
  5. Create a folder called wp-images and upload these images in this folder.
  6. Now, go to your WP theme folder and look for the post.php file and open it for editing. Check again, you may also need to edit the index.php file.
  7. Look for the date function as such:

< ?php the_time(‘D, M j’) ?>

Now break that into 3 parts like this:

< ?php the_time(‘D’) ?>
< ?php the_time(‘M’) ?>
< ?php the_time(‘j’) ?>

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

< ?php $d = strtolower(get_the_time(‘D’)); echo (“< img src= ‘wp-images/{$d}.gif’ > “); ?>
< ?php $m = strtolower(get_the_time(‘M’)); echo (“< img src= ‘wp-images/{$m}.gif’ > “); ?>
< ?php $j = strtolower(get_the_time(‘j’)); echo (“< img src = ‘wp-images/{$j}.gif’ > “); ?>

Popularity: 8%

Related posts:
  1. How To Display Last Modified Date On Wordpress Post Hi, In many cases you may want to display updated...
  2. How To Change BackGround Image In Wordpress Blog Hi, In order change the background image of your blog,...
  3. How To Display Today’s Date On Wordpress Blog Hi, Many wordpress users wants to display today’s date at...
  4. List of Date and Time tags- Template Tags the_time the_date the_date_xml the_weekday (Deprecated) the_weekday_date (Deprecated) the_modified_time the_modified_date (Version...
  5. How User Can Change Header In Wordpress MU Blog – Customize Header In Wordpress MU Theme Hi, WordPress MU is the Custom header API. This service...

Leave a Reply

You must be logged in to post a comment.