Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

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,632 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,632 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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


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 11:30 PM.


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