Okay, so you know how you can break up a wordpress post by inserting the next-page/page break quicktag. Then, using the wp link pages function in your template, wordpress will generate page 1, 2, 3, etc. links for your now paginated post.
Great. But is there any way to put the post back together again? Think about all the online magazines and newspapers that break their articles into pages and then offer some variation on a “single page view.” Can you do that with WordPress? I spent the whole weekend trying to google a solution and came up with exactly nothing.
Yes, it is possible, and I use it on my own site. Here it is in action: my Settings API post is paginated, but can viewed on a single page, using the “Single-Page View” link.
First, you need to prepare a custom query variable, e.g. in
functions.php
, add the following:Second, inside the Loop, you need to replace your basic call to
the_content()
with the following:Then finally, you need to add a link to generate the single-page view, e.g. next to your “Permalink” and “Comments” links in your Post Meta:
Now, when you clock the “Single-Page View” link, the entire post content will appear on a single page.
Note: h/t to this WPORG support forum topic