Title: WPML support
Last modified: August 30, 2016

---

# WPML support

 *  Resolved [pimschaaf](https://wordpress.org/support/users/pimschaaf/)
 * (@pimschaaf)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/wpml-support-43/)
 * For WPML support, filters need to be applied on the query that gets the results(
   as is done in wp_get_archives()). I found the following to be working:
 *     ```
       /**
        * Filter the SQL WHERE clause for retrieving archives.
        */
       $where = apply_filters( 'getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'" );
   
       /**
        * Filter the SQL JOIN clause for retrieving archives.
        */
       $join = apply_filters( 'getarchives_join', '' );
   
       //the following is the query from widget-archives.php:59 with added $jon and $where
       if ( $months = $wpdb->get_results( "SELECT YEAR(post_date) AS <code>year</code>, MONTH(post_date) AS <code>num_month</code>, DATE_FORMAT(post_date, '%M') AS <code>month</code>, count(ID) as <code>post_count</code> FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date" ) ) {
   
       // rest of the code follows
       ```
   
 * [https://wordpress.org/plugins/better-archives-widget/](https://wordpress.org/plugins/better-archives-widget/)

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

 *  Plugin Author [Paul de Wouters](https://wordpress.org/support/users/pauldewouters/)
 * (@pauldewouters)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/wpml-support-43/#post-6742127)
 * Pull requests accepted [https://github.com/pdewouters/better-archives-widget](https://github.com/pdewouters/better-archives-widget)
 *  [jumust](https://wordpress.org/support/users/jumust/)
 * (@jumust)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/wpml-support-43/#post-6742233)
 * Where should I add the above lines of code?
 *  [michaelcellier](https://wordpress.org/support/users/michaelcellier/)
 * (@michaelcellier)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/wpml-support-43/#post-6742240)
 * I made a pull request based on the code above : [https://github.com/pdewouters/better-archives-widget/pull/3](https://github.com/pdewouters/better-archives-widget/pull/3)
 *  Plugin Author [Paul de Wouters](https://wordpress.org/support/users/pauldewouters/)
 * (@pauldewouters)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/wpml-support-43/#post-6742241)
 * Available in new version
 *  Thread Starter [pimschaaf](https://wordpress.org/support/users/pimschaaf/)
 * (@pimschaaf)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/wpml-support-43/#post-6742242)
 * Thanks guys. Never quite got around to writing that pull request. Great to see
   it added! Keep up the good work!

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

 The topic ‘WPML support’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/better-archives-widget_f0f1ef.svg)
 * [Better archives widget](https://wordpress.org/plugins/better-archives-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-archives-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-archives-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/better-archives-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-archives-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-archives-widget/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [pimschaaf](https://wordpress.org/support/users/pimschaaf/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/wpml-support-43/#post-6742242)
 * Status: resolved