Date format in a function WordPress ACF -
i have asked similar question in past still have issues... therefore placing whole function here.
can tell me how change format date output? shows 20130731 want show 31st july 2013
function le_detail() { ?> <div class="event"> <!--standard wp - use 'echo' --> <h2 class="button"> <?php echo get_the_title(); ?> </h2> <!-- acf - no 'echo' --> <h3><?php the_field('where'); ?></h3> <h3><?php the_field('when'); ?></h3> <p><?php the_field('description'); ?></p> <p>chairman: <?php the_field('chairman'); ?></p> </div> <?php }
the date line: (this using advanced customs fields plugin)
<h3><?php the_field('when'); ?></h3>
acf plugin having get_field('') function value of custom field. since have used 'when' field name, follows:
<h3><?php echo date("ds f,y",strtotime(get_field('when'))); ?></h3>
use above code snippet, solve problem.
Comments
Post a Comment