3
votes

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.

1
can you define wrong? what is wrong? does it return one but not the other or does it return something else? some example of returns would help - vico
Like I said it should return only posts in current language like on other pages and not posts in all languages - that's the whole point in using WPML - j99

1 Answers

1
votes

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)"