admin管理员组文章数量:1389825
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/
本文标签: functionsRemove the month and year from a WordPress Date
版权声明:本文标题:functions - Remove the month and year from a WordPress Date? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744707548a2620931.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