Child categories in the block

Posted in: Newspaper
Post count: 17

Hello Radu.
I would like to include in a block only one category while avoiding its child categories.
And ‘possible?
Thank you.

Post count: 3343

Hi,
Change like here: category__in
http://screencast.com/t/2wuyeWq3oz8p

Thanks!

Post count: 17

Thank You Marius.
It works, too.
With the fix that you proposed:
– If I enter a category in parent dropdown list, is ok.
– If I enter a category id in the “Multiple categories filter”, everything is ok.
– But if I enter more than one category id in the “Multiple categories filter” only appears the first.
Is there a solution?
Thank you.

Post count: 3343

Hi,
Try this: http://screencast.com/t/PrzjKevw
$wp_query_args['category__in'] = $category_id;
$wp_query_args['cat'] = $category_ids;

Now if you use the Multiple categories filter: will work like was original. (is you choose a parent will show sub-categories to)

And if you use only the Category filter and choose a parent category , now will display only post from that parent category.

Try and see if works ok.

Thanks for the message!

  • This reply was modified 12 years by Marius.
Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.