Fix or Change the Post Date Format in WordPress

Filed Under (WordPress, fix) by chris on 01-21-2010

Tagged Under : , ,

For quite sometime, the post date format has not bee what I wanted. It was displaying day-month-year ( 21-1-10). This was confusing some of my readers. I tried to change it in the WordPress dashboard under Settings, but it never made a difference. I searched for a solution and found several people had the same problem but no one actually had a good answer. However, one of the posts refered me to Customizing the Time and Date and while this was just the formatting of the date and time, it did give me a clue of what to look for.

WordPress is written in the programming language PHP. The date formatting functions in WordPress use PHP’s built-in date formatting functions. You can use the table of date format characters on the PHP website as a reference for building date format strings for use in WordPress.

Armed with this information, I went to my WordPress dashboard and clicked on Appearance and then Editor. Then I started going through the Template Theme files. Sure enough, I found <?php the_time(‘D, m-d-Y’) in the Main Index Template (index.php) file. So I went back to the FormatĀ  page to see what options I had and decided on the day, month-date-year for my format. So I changed <?php the_time(‘D, m-d-Y’) to <?php the_time(‘D, m-d-Y’) and then clicked on update. And as you can see, the dates of my posts, on the main page, now have the post date formatted the way I wanted.

The other place you can change the time and date format is in Single Post (single.php) which I did a little different that my main page. I decided to go with l, F jS, Y which will look like: Friday, January 22nd, 2010

UPDATE: I found a couple other places that needed to be changed in my theme. So here is a list of the files that I could change my date format in.

Archives (archive.php)

Comments (comment.php)

Main Index Template (index.php)

Single Post (single.php)

Hope this helps. If you have any questions, leave me a comment and I will try to help.

Word Press Login Security Issue

Filed Under (0day, blog support, fix, word press) by chris on 08-11-2009

Tagged Under : ,

This just in from the Internet Storm Center

Juha-Matti pointed out multple reports on a vulnerability in the widely used wordpress blog software that supposedly allows lets remote users reset the administrative password. They all lead to an original post on a full disclosure mailing list.

You can get all the details from the original post – Wordpress unauthenticated administrator password reset

You can find the fix here

Basically you just need to change line 190 in wp-login.php from
if ( empty( $key )
to
if ( empty( $key ) || is_array( $key ) )
If line 190 in wp-login.php doesn’t match the example, you should update Word Press.

I’ve already done it here and everything still works. I also tried it on a version of Word Press that isn’t the latest version. I had to search for the string that needed changing because it’s not on line 190 in the older version. I updated the info and everything is working there too.

7 visitors online now
7 guests, 0 members
Max visitors today: 11 at 03:12 am UTC
This month: 47 at 03-06-2010 07:06 pm UTC
This year: 165 at 01-11-2010 09:16 pm UTC
All time: 165 at 01-11-2010 09:16 pm UTC