I’m trying to get wordpress post by filtering date and time,
for example get post 01/02/2014 to 07/02/2014.
thanks for the help me.
2 comments
Comments are closed.
I’m trying to get wordpress post by filtering date and time,
for example get post 01/02/2014 to 07/02/2014.
thanks for the help me.
Comments are closed.
Try to use
new WP_Query
for this.Add a new query and pass below argument.
There are lot of date related parameters you can specify in a custom query.
You have to use WP_query to fire a new query to get the results.
In this scenario your custom query should contain parameters ‘date_query’ along with other parameters. I have tried it and It worked for me. Just change your dates.
There is an alternative way to define ‘before’ and ‘after’ too.
You can also write the before parameter like this:
similarly with ‘after’ parameter.