FAQ: How do I break a post into several ‘slides’ in WordPress?

child on slide

Many of us have noticed that the bigger sites and magazines are breaking up their posts into bite sized pieces when it makes sense. If we stop for a moment – this also makes great sense from an advertising standpoint too. Great idea, right?

Although this is little used, it’s a built-in function in WordPress and oh-so-easy to use.

1. Use a built in quick tag where you’d like the post to split.

<!–nextpage–>

2. Insert the function into your theme if it isn’t there already. This must be used within the loop – usually on the post template: single.php.

 '

' . __('Pages:'), 'after' => '

', 'link_before' => '', 'link_after' => '', 'next_or_number' => 'number', 'nextpagelink' => __('Next page'), 'previouspagelink' => __('Previous page'), 'pagelink' => '%', 'echo' => 1 ); wp_link_pages( $args ); ?>

3. If you’d like to display/show various elements (social media sharing, ads, or call-to-action), you’ll need to use this snippet within the loop as well:

 $paged = $wp_query->get( 'page' );

if ( ! $paged || $paged < 2 )
{
// This is not a paginated page (or it's simply the first page of a paginated page/post)

}
else
{
// This is a paginated page.

}
 

Genesis Users

Unfortunately, I haven’t had to play with this yet so I don’t have a working example. I imagine, you’ll need to create a custom call back for the loop, and add your paged tests there. This is all done in either a custom single.php or functions file, depending on how you like to organize your child themes.

Tips for us?

Have you done this in your theme? Was there any user reaction to paged posts?

Share to Facebook Share to Twitter Share Share to StumbleUpon