Skip to content

Instantly share code, notes, and snippets.

@softiconic
Last active December 2, 2023 18:54
Show Gist options
  • Save softiconic/5a43e3db1d47569de03b563164b0f0e6 to your computer and use it in GitHub Desktop.
Save softiconic/5a43e3db1d47569de03b563164b0f0e6 to your computer and use it in GitHub Desktop.
Configure the ACF date picker to display only the day and month.
<?php
if(get_field('date'))
{
$datetime = DateTime::createFromFormat('d/m/Y', get_field('date'));
$fecha_dia = $datetime->format('d');
$fecha_mes = $datetime->format('M');
}
?>
<span><?php echo $fecha_dia; ?></span>
<span><?php echo $fecha_mes; ?></span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment