Using the Layout Builder

FacetWP includes a built-in layout builder. It allows you to quickly spin up a listing or grid template, which can then be used in alongside any number of facets.

Browse to Settings > FacetWP and click “Add template”. New templates use the Layout Builder by default. If more flexibility is required and you’re experienced with WordPress development, you could switch to Advanced mode.

The Layout Builder is covered in the above video, starting at 1:49.

Using dynamic tags

Dynamic tags let you pull a field’s value into another field.

Let’s say you have a photo_url field and you want to wrap it into an <a> tag. First, add a new layout item and select the desired field:

Selecting item source

Next, set the layout item’s “Name” to photo-url and mark it as hidden:

Editing layout item

Finally, add a new HTML item and set its “Content” to:

<a href="{{ photo-url }}">{{ photo-url }}</a>

FacetWP automatically replaces all instances of {{ photo-url }} with the custom field’s value. You can even pull in multiple fields.

Built-in tags

The layout builder includes 3 built-in tags that can be used throughout the layout builder (such as within an HTML item):

{{ post:id }}

{{ post:name }}

{{ post:url }}

Outputting a template

Templates are added to your pages via shortcodes. See the “Shortcodes” section below for more info.

See Also