Hi there,
I love the plugin but I have similar problem.
But I hope I will find the way how to resolve this problem.
(I am using porcelain theme)
I have 3 languages and normal sites works great.
But when its come to portfolio:
for just one language it is work fine.
But when I have add translated categories to the other languages –
on “all” PL I have all things from EN categories – categories list disappeared
on “all” EN I have all thing that belongs to PL categories – no categories list
on “all” RU I have, categories list, and all things for |PL language.
link to the page: http://klienci.rabu.pl/makow/oferta-dla-cateringu-hurtu-i-przemyslu/
It is working in here like I need to exclude some categories – and it not works.
One more thing when I haven’t any object in RU category then,
PL and EN versions had category list like it is now on RU,
and when You clicked on certain category then You had what you picked.
but in “all” there were: on PL – English object, on EN – polish objects.
Thank You for your look up!
Plugin Author
Chouby
(@chouby)
@tiago ADPS
I believe that your problem is that you totally reset the query. You should keep existing query vars with something like
global $wp_query;
query_posts(array_merge($wp_query->query, array('category__not_in' => 23)));
@zofijeczka
As per forum rules, please don’t pollute this thread and open a new one, as your question is not the same.
Hello Chouby,
Thank you for the answer.
The problem still persists though.
The original code is working as it should, but if I use:
<?php global $wp_query;
query_posts(array_merge($wp_query->query, array('category__not_in' => array( 61, 85 )))); ?>
Right before the:
<?php if ( have_posts() ) : ?>
Both categories are removed, but all the posts from the second language are added.
Am I doing something wrong? I’m sorry if so, but my php skills are very… moderate.
Thank you very much once more.
Any other thoughts on this? Is it a bug or am I doing something wrong?
Thank you
Hi Tiago ADPS,
It’s a long time but have you find a way to solve that issue ?
I’m facing something similar now.
Cheers
If I remember right, I had to work it out fast so I just built a custom page for the blog that called a category named… well “Blog”.
This way all the other categories weren’t listed and Polylang worked fine.
I worked around it basically π
But I would be more sure about this if I remembered which project I was working at the time. I tried to look at a list, but I can’t pinpoint this case exactly.
OK, thanks your fast answer. I will somehow else π
Hello Chouby, Tiago ADPS and 916VT.
I’m facing the same trouble now.
I love polylang, but it look like it’s not working when I try to exclude a category.
Here is my code:
global $wp_query;
$args = array(
'post_type' => 'post_type',
'posts_per_page' => 20,
'order' => 'DESC',
'cat' => '-46'
);
$wp_query = new WP_Query($args);
When I try to exclude the category 46, I get all the post of the post type ‘post-type’ in all languages.
Am I doing something wrong?
Thanks a lot!
Add to your array something like :
'lang' => 'fr_FR'
(fr_FR is may be not the right way to select the langage)