Quantcast
Viewing all articles
Browse latest Browse all 11471

panotar on "[Plugin: Polylang] Showing default language post if no translation is available"

Hey fokkezb,

your modification looks like what I need. I'm running a german blog with the occasional english post in between. I want to display all posts by default on the 'german' page, and only the english ones (which are original post, no translations) behind the language switch.

However, I'm not able to reproduce your example. I am putting this block

<?
global $wp_query;
$language = pll_current_language();
query_posts(array_merge($wp_query->query, array('post_type' => 'post', 'lang' => ($language == 'en' ? 'en' : 'en,de')))); ?>

right before the 'have_posts', resulting in this line: query, array('post_type' => 'post', 'lang' => ($language == 'en' ? 'en' : 'en,de')))); ?>

being written on top of my pages in the frontend. :(

This is propably easy for people with programming skills but hard for me :) Any help is much appreciated.

Thanx, panotar


Viewing all articles
Browse latest Browse all 11471

Trending Articles



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