All languages on Homepage
-
Hi
I’m using Polylang on Expression Theme. My problem is that on Homepage I get posts in both languages I use. I tried Tips & Tricks written here before but then it fixes problem for one language while for my default it shows all pages (not posts) in all languages.
Is there anyway to fix it?This is my fixed code:
$postsPerPage=get_opt(‘_post_per_page_on_blog’)==”?5:get_opt(‘_post_per_page_on_blog’);
$excludeCat=explode(‘,’,get_opt(‘_exclude_cat_from_blog’));$build_homepage_query = array (
‘category__not_in’ => $excludeCat,
‘paged’ => get_query_var(‘paged’),
‘posts_per_page’ => get_opt(‘_post_per_page_on_blog’)
);
$build_homepage_query = array_merge($GLOBALS[‘wp_query’]->query_vars, $build_homepage_query); //when this line is disabled I get all language version posts on homepage
query_posts($build_homepage_query);
- The topic ‘All languages on Homepage’ is closed to new replies.