Forum

Thread tagged as: Question, Problem, Configuration

Excluding a category

Hello again!

Following on for yesterday ...

I have my activities list which is categorized by 2 sets of categories:- Destinations with list of cities as categories and Types with categories, Hen Only, Stag Only, Hen and Stag.

I have filtered by list of activities with the relevant destinations but I want to exclude a category from this list. I have tried the following as an example using ! but it does not seem to work in the array. I can get the correct destinations list or exclude the correct category but not both in conjunction.

perch_category('destinations/'.perch_get('s').'/', array(
  'template' =>'category-single.html'
));
perch_content_custom('Activities', array(
               'template' => 'act-list.html',
               'page'=>'/activities.php',
                'category' =>'!types/hen-only/' , 'destinations/'.perch_get('s'), 
          )); 

Denise Courtney

Denise Courtney 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You need to make them an array:

'category' => ['!types/hen-only/' , 'destinations/'.perch_get('s')], 

Thank you!