Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   [SOLVED] Format Date for Custom fields using %meta(fieldname)% (http://forum.bytesforall.com/showthread.php?t=2736)

grasshopper Jul 30, 2009 01:03 PM

[SOLVED] Format Date for Custom fields using %meta(fieldname)%
 
Hi All -

I hope one of you can help.

I am using custom fields in my posts. In order to display them I entered the following in BYLINE: Multi Post Pages section. <B>START DATE:</B> %meta('start_date')% <br />

It works great, but, now I want to format the date. I looked at the various threads re: date formatting and custom fields and even changed some of the PHP of bfa_postinfo.php according to the instructions, but nothing seems to work.

could someone tell me how to change the format to be as follows:

l, F j, Y

Thanks so much.

juggledad Jul 31, 2009 04:49 AM

why not use '%date('l, F j, Y')%' instead of the '%meta('start_date')%'?

grasshopper Jul 31, 2009 07:25 AM

Hi Juggledad -

Thanks for your response.

Unfortunately, the %date() convention displays the date that the post was created. I should have been more specific about what I'm trying to do. I am posting classes/workshops with specific event dates. For example, a class would run from October 5, 2009 through November 4, 2009. So, I'm trying to format those manually entered dates.

Is this possible? Thanks again for your help!

juggledad Jul 31, 2009 08:10 AM

Ok, so why not enter the dates the way you want them displayed?

the custom field is just a generic data holder. If you want to manapulate it as a date, you are going to have to code an entire php chuck of code to do the conversion (you might find php functions to help)
After all, it could contain '08/01/09' or '08/01/2009' or ' 08/01/2009' or '08/01/2009 ' etc, etc

grasshopper Aug 1, 2009 08:01 AM

Hi Juggledad -

Sorry for the late reply. I was having IT troubles and spent the entire day yesterday trying to fix those.

Anyway, I wanted to thank you for your help and suggestions. For some reason, entering the dates as I wanted them to display didn't work. So, I stripped everything out and decided to go another route. It's working now.

Thanks again for your help.


All times are GMT -6. The time now is 06:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.