Reputation: 285
I am using Wordpress with WPML plugin (2 languages). I execute following WP_Query in header of all pages to get the results of my custom post type (slideshow):
$slideshow = new WP_Query(array( 'post_type' => 'slideshow', 'showposts' => 20 ));
Query works fine on homepage, posts, pages, archives and returns last 20 items from my custom post type "slideshow" in CURRENT language. But when I visit my custom post type page (e.g. /custom-post-type/post-name) the same query returns last 20 items from ALL languages which is wrong!
What can I do? I also tried experimenting with supress_filters true/false as suggested on various forums around the web but with no luck - it returns the same posts in any case.
Upvotes: 3
Views: 2421
Reputation: 285
The problem was in custom post slugs translation... To fix this navigate to WPML > Translation management > Multilingual content setup and UNCHECK "Translate custom posts slugs (via WPML String Translation)"
Upvotes: 1