1

I'm trying to create simple events list from posts and for event date I'm using default publish date, but there is a problem when I need to insert event with the start and end date.

If I use custom field for the end date, I can display date, but I can't sort them and that's most important thing on this site. I also need to display the end date in 3 ways: "l, j. m.", "j. m." and "D, j. m.".

Is there any plugin for date range in default posts page (I didn't find anything) or do you have any idea what to do?

Thanks,

4

1 回答 1

0

wp_query 中的日期范围目前不支持开箱即用。您可以使用 $wpdb 完成此操作,并使用 compare BETWEEN 格式编写选择语句。那是一个MYSQL问题。

这里有一个很好的 BETWEEN 日期/时间范围示例: MySQL: Compare BETWEEN time

如果您的日期/时间是标准格式,您可以使用 strftime 输出时间,如下所示:http: //strfti.me/

于 2012-09-08T01:18:16.203 回答