Using advanced mode

If you browse to Settings > FacetWP and click “Add template”, FacetWP will default to using the Layout Builder. However, if more flexibility is required and you’re experienced in WordPress coding, you can switch your template to advanced mode.

Display Code

When the “Display” tab is active, click the Switch to advanced mode link.

The Display Code box is used for generating the template output. The following example will output the linked title for each post item.

<?php while ( have_posts() ): the_post(); ?>
<p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
<?php endwhile; ?>

Alternatively, you could put your display code into a PHP template file:

<?php
include( get_stylesheet_directory() . '/loop-index.php' );
?>

Query Arguments

When the “Query” tab is active, click the Switch to advanced mode link.

The Query Arguments box (based on WP_Query) determines the initial bucket of posts to load, how many per page, and in which order. Below, we’ll fetch published posts, and show 15 per page:

<?php
return array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'posts_per_page' => 15,
);

Outputting a template

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