@matthewbivins sorry for the late reply, just got back in town. Here’s the code that worked for me. It can be improved upon but did the job. Best of luck.
<?php
if(get_field('deadline'))
{
$date = DateTime::createFromFormat('Ymd', get_field('deadline'));
echo '<li><strong>Deadline: </strong>';
echo $date->format('F j, Y');
echo '</li>';
}
?>
Many thanks!
Yes, when I click the correct category, then the fields appear. The problem is the same thing happens when I click the wrong category (any category).
I can provide an admin login if needed to help resolve. Thanks.
Thanks for any assistance on displaying the Datepicker date as July 19, 2013 and not 20130719.
Let me know if there’s other documentation I should be looking at besides http://www.advancedcustomfields.com/resources/field-types/date-picker/
Thanks!
To be clear, I’m referring to the WYSIWYG editor on this forum site. Anyway, thanks for helping with my date formatting problem : )
Unrelated but odd … when I try to use the “link” tool in the WYSIWYG editor it shuts the entire site window after clicking the link window button (tried it a few times). Not sure if anyone else has this problem but thought I’d mention it.
Sorry but I’m not having luck with getting the date formatting to work, referring to the datepicker documentation page.
http://www.advancedcustomfields.com/resources/field-types/date-picker/
Here’s my code:
if(get_field('deadline'))
{
echo '<li><strong>Deadline: </strong>' . get_field('deadline') . '</li>';
}
I was trying this but end up with a blank page:
if(get_field('deadline'))
{
$date = DateTime::createFromFormat('Ymd', get_field('deadline'));
echo '<li><strong>Deadline: </strong>' . $date->format('d-m-Y') . '</li>';
}
Thanks for any help!
Sure. Here goes.
This worked great! This is what I used:
$values = get_field('myfieldname');
if( count($values)){
foreach($values as $k=>$value){
if($k) echo ', ';
echo $value;
}
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.