I’m using «Stella-plugin» on a project I’m working on and while working on the archive page, found out that in free version of Stella when using the «wp_get_archives()» it does not filter on the current selected language.

To fix that, all you have to do is create a function in «functions.php»-file and attach into the «getarchives_where»-filter. Here is the code for you:


 * Empirio archive localizer ...
 * @param string $where
 * @return string
function __empirio_archive_localize($where){
    global $wpdb; $language = STELLA_CURRENT_LANG;
        $where.=" AND exists ( SELECT * FROM $wpdb->postmeta pm
            WHERE pm.post_id = $wpdb->posts.ID
            AND (pm.meta_key = '_title-{$language}'
            OR pm.meta_key = '_body-{$language}'))";
    return $where;

add_filter('getarchives_where', '__empirio_archive_localize');