Title: Filtering with dates too
Last modified: September 1, 2016

---

# Filtering with dates too

 *  Resolved [ebud](https://wordpress.org/support/users/ebud/)
 * (@ebud)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/filtering-with-dates-too/)
 * I would like to use to create a year dropdown filter.
    `<?php wp_get_archives(
   array( 'type' => 'yearly' ) ); ?>`
 * On a Custom post Type / Custom Tax page so I can further filter by year…
 * ending up with a link like this:
    /2016/cpt/tax/term/
 * which would generate a list of posts in a specific post-type, within a specific
   term, within a particular year.
 * Is this possible?
 * [https://wordpress.org/plugins/beautiful-taxonomy-filters/](https://wordpress.org/plugins/beautiful-taxonomy-filters/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Jonathandejong](https://wordpress.org/support/users/jonathandejong/)
 * (@jonathandejong)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/filtering-with-dates-too/#post-7639130)
 * Hi Ebud,
 * Hmm I’m afraid that those URLs are not possible unless you create your very own
   complex rewrite rules.
 * However BTF is extendable in that you can add your additional filtering, it just
   wont appear as a pretty permalink.
    So you could have something like: `/cpt/tax/
   term/?year=2016`
 * There are filters and actions you can use here ([https://wordpress.org/plugins/beautiful-taxonomy-filters/other_notes/](https://wordpress.org/plugins/beautiful-taxonomy-filters/other_notes/))
   to add your own dropdown to the module and hook into the redirection to add your`
   year` GET parameter. Then simply hook into `pre_get_posts` and if there’s a value
   for `$_GET['year']` add that to the query:
    `$query->set('year', $_GET['year'])`
 * I hope that’ll get you going 🙂
 *  Thread Starter [ebud](https://wordpress.org/support/users/ebud/)
 * (@ebud)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/filtering-with-dates-too/#post-7639132)
 * Nice detail and thanks for the response.
 *  Plugin Author [Jonathandejong](https://wordpress.org/support/users/jonathandejong/)
 * (@jonathandejong)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/filtering-with-dates-too/#post-8147885)
 * No problem! Hope you managed to sort it out and best of luck with your coding!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Filtering with dates too’ is closed to new replies.

 * ![](https://ps.w.org/beautiful-taxonomy-filters/assets/icon-256x256.png?rev=1654967)
 * [Beautiful taxonomy filters](https://wordpress.org/plugins/beautiful-taxonomy-filters/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/beautiful-taxonomy-filters/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/)
 * [Active Topics](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jonathandejong](https://wordpress.org/support/users/jonathandejong/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/filtering-with-dates-too/#post-8147885)
 * Status: resolved