diff --git a/includes/lib/transifex-live-integration-subdirectory.php b/includes/lib/transifex-live-integration-subdirectory.php index c9d6bfd..11fe3de 100644 --- a/includes/lib/transifex-live-integration-subdirectory.php +++ b/includes/lib/transifex-live-integration-subdirectory.php @@ -224,6 +224,12 @@ function custom_slug_rewrite_rules_hook() { foreach ($all_post_types as $post_type) { $post_type_object = get_post_type_object($post_type); $slug = $post_type_object->rewrite['slug']; + + // Handle archive templates of custom post types + if (!empty($post_type_object->has_archive)) { + $rules['%lang%/' . $post_type_object->has_archive . '?$'] = 'index.php?post_type=' . $post_type . '&lang=$matches[1]'; + } + $posts = get_posts(array( 'post_type' => $post_type, 'numberposts' => -1