Displaying categories
Categories can be nested as deeply as you wish.
Here's an example of showing two levels deep for your image gallery categories:
<?php echo $fms->categories( array('type' => 'gallery', 'levels' => 2) ); ?>
You can use any combination of options, with as few or as many as you choose.
The complete list of options
- type
Get the type of category (gallery or layouts). If no type is chosen, defaults to gallery
- title
If set to false, the title is not shown. If anything else, FMS will use it as HTML tags surrounding the title (h2 will give <h2>Title</h2>). Defaults to h2
- list
The HTML element to wrap each category in the list. Defaults to li
- slug
Defines whether or not you want to make the category a link, with true or false. Defaults to true
- levels
The number of levels of children. For example, if you have Backgrounds > Dark > Grunge > Animated, setting levels to 2 will display Backgrounds > Dark > Grunge. Defaults to 2
- count
Displays a count of the number of items in each category; true or false; defaults to true
- class
Gives the HTML surrounding your categories a class. A class of menu will display <ul class=“menu”> <li>Category</li> </ul>. Defaults to menu
