# How can I display faceted search results with WordPress?

**URL:** <https://community.swiftype.com/t/how-can-i-display-faceted-search-results-with-wordpress/149>\
**Category:** WordPress\
**Created:** [April 8, 2016, 9:51pm UTC](https://community.swiftype.com/t/how-can-i-display-faceted-search-results-with-wordpress/149 "2016-04-08T21:51:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/swiftype/original/1X/fd652d1735c60057fa71c371375511028f9a1832.png) [@system](https://community.swiftype.com/u/system)\
**Post date:** [April 8, 2016, 9:51pm UTC](https://community.swiftype.com/t/how-can-i-display-faceted-search-results-with-wordpress/149/1 "2016-04-08T21:51:05Z")

</div>

The Swiftype Search WordPress plugin version 1.1.38 and greater provides the **`swiftype_render_facets`** theme function to enable you to easily add faceting to your search results page. To use it, follow these steps:

- Update to the latest version of the Swiftype Search WordPress plugin.
- Add a **`swiftype_search_params_filter`** function to your theme’s **`functions.php`** file that adds facet parameters to the search.

```php
function swiftype_search_params_filter($params) {
    $params['facets[posts]'] = array('tags', 'category');
    return $params;
}

add_filter('swiftype_search_params', 'swiftype_search_params_filter', 8, 1);

```

- Add a `swiftype_render_facets()` call to your `search.php` template. This is what actually renders the facets. You should place it where you want the facets to be rendered:

`<?php swiftype_render_facets(); ?>`

- _(Optional)_ Style the facets using CSS. You can target **`div.st-facets`** for your CSS rules to only affect the content inside the facets container.
