Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Post-Kicker, -Byline & -Footer »

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


  #1  
Old Jul 30, 2009, 01:03 PM
grasshopper
 
20 posts · Jun 2009
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.
  #2  
Old Jul 31, 2009, 04:49 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
why not use '%date('l, F j, Y')%' instead of the '%meta('start_date')%'?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jul 31, 2009, 07:25 AM
grasshopper
 
20 posts · Jun 2009
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!
  #4  
Old Jul 31, 2009, 08:10 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Aug 1, 2009, 08:01 AM
grasshopper
 
20 posts · Jun 2009
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.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Format comments alickerman Comments, trackbacks & pings 7 Oct 1, 2009 04:17 AM
Custom Fields Cannot be Deleted elenniel Post-Kicker, -Byline & -Footer 6 Aug 31, 2009 08:00 AM
Custom post fields wwday3 Post-Kicker, -Byline & -Footer 8 Jul 28, 2009 11:39 AM
[SOLVED] Display Custom Fields and Values Under Post Heading grasshopper Atahualpa 3 Wordpress theme 4 Jul 2, 2009 12:40 PM
Need help with "%meta('fieldname')%" Antsliedown Post-Kicker, -Byline & -Footer 5 May 2, 2009 08:43 PM


All times are GMT -6. The time now is 12:17 AM.


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