So, I am wondering if there is a way that I can make this:
February 28th, 2020
Just output NO month and NO year so just 28th (i.e. just the date)
What approach would you take?
I am applying this to a WordPress plugin called Pods.
The plugin allows for Custom Fields to be printed like this:
{@date}
And I know that you can run a PHP command from the functions file like this:
{@date,remove_month}
But figuring how to do that is tricky...any pointers?
So, I am wondering if there is a way that I can make this:
February 28th, 2020
Just output NO month and NO year so just 28th (i.e. just the date)
What approach would you take?
I am applying this to a WordPress plugin called Pods.
The plugin allows for Custom Fields to be printed like this:
{@date}
And I know that you can run a PHP command from the functions file like this:
{@date,remove_month}
But figuring how to do that is tricky...any pointers?
Share Improve this question asked Feb 28, 2020 at 13:20 HenryHenry 9831 gold badge8 silver badges31 bronze badges 2 |1 Answer
Reset to default 1You’ll need to write your OWN function that will take the post_date and return it reformatted to the style you’re looking for.
function my_date($input_date) {
return date("S", strtotime($input_date));
}
And then you would call it within your Pods Template like
{@post_date, my_date}
All rights goes to Jim True. More infomations : https://pods.io/forums/topic/date-formatting-using-magic-tags/
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744707549a4589145.html
jS
. But how the plugin works / how you do this will be specific to the plugin, so you'd have to ask them or read the code to figure it out yourself. – Rup Commented Feb 28, 2020 at 13:24