Forum

Thread tagged as: Question, Problem, Configuration

Sub categories

Hello

I have a set - Products with some main categories Prints, Canvases, Acrylics etc, Within each of these categories are some subcategories.

If I use the function

<?php perch_categories(array( 'set'=> 'products', 'template' => 'mainproducts.html',

                )); ?>

It gives me all the categories and sub categories. Is there a way I can just show the main categories (1st level)?

Denise Courtney

Denise Courtney 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You should be able to use

'filter' => 'catParentID',
'match' => 'gt',
'value' => 0,

thanks for the very quick response Drew!

Just tried that but it gives me the sub-categories rather than just the categories.

Got it!

'filter' => 'catParentID', 'match' => 'eq', 'value' => 0,