Implementation

Post Explorer is controlled and initiated by placing the [post_explorer] shortcode directly inside your single post or custom post type template.

There are two basic steps involved to completing the Post Explorer implementation process:


Step 1: Post Template Wrapper

The first step is to ensure your single post template is wrapped in a unique HTML element that can be accessed by Post Explorer. This is crucial as Post Explorer will only render content inside this wrapper while loading posts.

The template wrapper must have a unique class (.post-container) or ID (#container) and wrap the entire repeatable content area of the post. This wrapper is required and will be referenced by the target shortcode parameter, as seen in step 2.

In the code snippet below, the repeatable content area (<article></article>) is wrapped in a #post-wrapper div for targeting.

Note: Post Explorer will only load content nested inside your template wrapper.


Step 2: Adding the Shortcode

The next step is to create a shortcode using the shortcode builder and place it inside your single template at the location you want Post Explorer to appear on the page – the shortcode must be added using the do_shortcode method.

In the code snippet below, the [post_explorer] shortcode is added just below the new #post-wrapper div. You will notice that #post-wrapper is referenced in the target parameter of the shortcode – this is a required parameter.


And that’s all there is to it – with the template wrapper and shortcode in place, Post Explorer will start loading your next and previous posts with Ajax.