Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Display Posts Filtered by Date Range

How can I display posts on a page and that were created during a certain date range? For example, I want to show posts from author id "12" from 1/1/2013 to 6/1/2013.

Is there a short code solution such as:

[su_posts author ="12" date_start="1/1/2013" end_date="6/1/2013]

Or could there be a plug-in that provides this functionality?

1 Answer

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Your best bet is to just use WP_Query with the date query parameters. There are some examples on the wp.org forum.

You might be able to what you're looking for with a plugin like this but I've never tried that specific plugin.