Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

toskan on "Polylang for fallback language, problem with pagination to second page"

$
0
0

Following scenario

I am using this in my archive.php:

if (is_category()) {
            $categories = get_the_category();
            $category_id = $categories[0]->cat_ID;
            $deCatId = pll_get_term($category_id, "de");
            query_posts(array_merge($wp_query->query, array('post_type' => 'post', 'lang' => 'de', 'cat'=>$deCatId)));
            echo var_dump(query_posts(array_merge($wp_query->query, array('post_type' => 'post', 'lang' => 'de', 'cat' => $deCatId))));
        }

Now there are hundreds of posts in the default language which is german (de) but only like 3 posts in english. Now when I want to use pagination to the next page, when using english, I get a "Page Not Found" error. Obviously, because the system thinks there is no page 2 in english. But since I am using german as a fallback language, there is in fact, a page 2. Just with registered posts in german.

Is there a way around this problem?

https://wordpress.org/plugins/polylang/


Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>