WordPress Date & Time Formatting

Category: Code & Design
2 Comments | Add Yours

Call it OCD, but I’m a little anal when it comes to designing layouts because I want them to look exactly how I envision it. When I started using WordPress, I had to learn through dozens of tutorials and FAQ’s to create my current theme.

One issue I came across was the ability to display the date on all entries. I noticed that when I published two or more entires in one day, the date would only show on the more recent post of that day, leaving an empty line between the title and category. The code I originally used was:

<?php the_date() ?>

After scouring the Internet for a solution, I realized that in order to display the date on all entries, I would have to change the code to this:

<?php the_time(‘j’) ?> <?php the_time(‘F’) ?> <?php the_time(‘Y’) ?>

This is a longer, more specific code that tells the page to load the date, month, and year every time, regardless of multiple entries in one day.

I hope you find this helpful because it took me a while to figure it out! ;)

For more information on customizing the date and time, check out WordPress Codex.








WordPress Smilies

Category: Code & Design
Comment On This Post

Smilies are glyphs used to convey emotions in your writing. By default, WordPress automatically converts text smilies into graphic images. Some examples are:

‘;-) is equivalent to smile emoticon

‘:-) is equivalent to smile emoticon

‘:-? is equivalent to confused

Needless to say, they’re a great way to brighten up posts! Now how can we customize these smilies? Simple!

  1. Find your smiley image files in the /wp-includes/images/smilies directory and back them up to another directory.
  2. Note the names of each smiley file. Your files must match these names and should be in the same ‘gif’ image format.
  3. For predictable behavior, the image sizes should be similar.
  4. Upload your new files to the /wp-includes/images/smilies directory with an FTP program.

You can also find WordPress Plugins to allow you to customize your smilies. :D

For more information on using smilies, check out WordPress Codex.