Thursday, December 29, 2022
HomeWordPress Developmentphp - Convert customized discipline date format to "Wordpress default"

php – Convert customized discipline date format to “WordPress default”


Hey girls and gents,

I am utilizing F j, Y (e.g. December 28, 2022) as default date format on my website (set within the admin settings). I’ve an occasion customized put up kind with an event_start_date customized discipline.

By default, event_start_date outputs a date in format Y-m-d (i.e. 2022-12-28), however I would like it displayed in the identical format as my default settings, i.e. F j, Y.

I can change this default format, and know I can add some code to my perform.php to transform it to a different format. However what I would love to do is convert is to no matter date format is about within the WordPress admin settings.

That method my buyer can change the date through WordPress admin settings and it’ll change the format all over the place, with out having to the touch the code.

I have never discovered something on how you can obtain that; is it attainable? Thanks on your assist.

PS: Moreover, I would like the date to be transformed wherever it’d present up: on a ‘static’ web page, in a question loop, and many others.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments