Custom Date Field | WordPress.org

[ad_1]

Hi There

I’m looking for a way to format a custom date field within a packing slip template. The code I’m using is below, and is straight from the plugin documentation:

$this->custom_field(‘_fulfilment_date’);

The above displays the date with no formatting. I have modified the code to below – as well as several version of this – to try and format it correctly, but this then displays the unformatted date right before the formatted date.

$date = $this->custom_field(‘_fulfilment_date’);
$formatted_date = date(‘d M Y’, strtotime($date));
echo $formatted_date;

Any help with how to achieve what I’m after would be much appreciated!

  • This topic was modified 1 hour, 59 minutes ago by WebDynamix.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer