Since it looks like there’s no existing way to do this, here’s my solution. It just splits the content on the pagebreak tag, parses the HTML and wraps each page in a div:
function get_paginated_post($post) {
$pagebreak = '<!--nextpage-->';
$raw_post = $post->post_content;
$pages = explode($pagebreak, $raw_post);
$html="";
foreach ($pages as $p=>$page) {
$html .= '<div class="page-' . ($p+1) . '">' . apply_filters('the_content', $page) . '</div>';
}
return $html;
}
Not beautiful, but does the job.
Related Posts:
- Why do you need an unlikely integer in paginating?
- How to get the number of Pages in a single Post Pagination?
- Paginate links with “ugly” and “pretty” permalinks?
- Next/Previous Links in same category
- How To create ajaxed wp-pagenavi?
- Using paginate_links() to generate “1, 2, 3 … 10, 20, 30, 40… 55” paginations
- Combining WordPress pagination functions for archives and search results
- Passing custom args in paginate_links
- Paginate a list of users?
- Allow Users to Choose Pagination or Next/Previous (Combine)
- Pagination that includes “view all on one page”
- Custom page-links for paginated posts | wp_link_pages quicktag
- Custom paging function
- Jetpack plugin – ‘posts_per_page’ not overriding ‘Blog pages show at most’ option, also different values for different post types?
- Pagination with get_posts seems to work but links not showing
- How to let crawlers search paginated comments?
- In pagination, change link for page 1 to homepage
- Pagination gives 404 in template
- Skip first post on Category Archive
- How do I insert CSS into a function?
- How to make multiple page out of one post
- wp_list_categories pagination
- Insert pagination links – wp_link_pages() – before filters on posts
- Remove h2 Tag in screen_reader_text
- Pagination for multiple queries for different authors on author.php
- WordPress 5.5 breaks pagination in an older plugin
- How to get “nexepagelink” and “previoiuspagelink” in wp_link_pages?
- Paginate Pages by only showing 3 pages at most
- Using Pagination with Timber Routes
- next_post_link for CPT only working for a few posts? weird!
- Pagination with $_POST and $_SESSION
- wordpress is converting ?page=2 into /2
- How to create Alphabetic pagination with range?
- Add pagination to my custom loop [duplicate]
- Site pagination issue
- Archive page pagination links redirecting to home page instead of going next page
- Default pagination is broken when use ‘static page’ as ‘front page’
- WordPress Gallery shortcode with pagination
- Paginate results from data fetched through array
- How to paginate with letters instead of numbers?
- Pagination in pages (not posts) with the twentythirteen theme?
- make a pagination that show posts by date
- How to customize pagination links?
- search with pagination not working as expected
- Post Pagination Showing Same Posts Every Page at wordpress blog
- Cannot go back to the first paginated page using pagination links
- Pagination for search results from a custom query
- Check if “Break comments into pages” is selected
- Remember form field values with page navigation
- Custom posts not paginating on archive page and returning 404
- Customizing Latest Post Pagination
- Woocommerce products per page dropdown
- WordPress Pagination is not shown
- Show multiple next and previous posts
- How to add pagination to category templates
- Hide content after going to page 2 of archive, show content when back at first page
- Make posts_per_page value the same on all pages
- Page not found yet the posts are listed?
- Search URL redirect problem
- split wordpress loop into columns of categories and associated posts
- Adding pagination to a custom template that uses custom post types?
- Why are my paginated result links not working?
- Pagination don’t list all entries on Index.php
- WordPress default gallery pagination when in page (is_page)?
- How do I hide a Gutenberg block when paginating
- Understrap Custom Pagination
- Pass global variable from Page 1 to page 2 (Pagination)
- How to remove url from omission dots in WordPress pagination?
- Pagination not working on archive.php
- Pagination not working in custom post type but perfectly in posts
- Pagination 301 redirecting page 1
- change pagination url
- Remove “Page” from Category archive
- Using the_posts_pagination with offset adds extra empty page
- Creating a Back button on detail post page to go back to blog page with same query strings and page id
- get_posts custom paging
- page/2 not working in wordpress it showing 404 page erorr
- How to implement pagination eg. newer – 3 – 4 – 5 – 6 – 7 – older
- Extra pagination pages being wrongly generated
- 404 Pagination issue for only one category
- 404 Error on pagination with WP Query
- What is wrong with my code ? pagination does not show up
- Pagination re-direct to main page [duplicate]
- Paginating custom posts in categories yields a 404 error
- Using WP_List_Table and search_box(): How to Paginate the Found Search Results When Sending by Method «Post»?
- URL rewrite function and pagination with year in the url
- How do I make pagination_links show as 01 02 03, instead of 1 2 3?
- wordpress pagination problem with page templates
- Pagination for custom post type not working [duplicate]
- wordpress pagination fix after the_posts
- WordPress pagination with Bootstrap 4 and Grid content Display
- Pagination with wp_pagenavi not working on custom page
- how to apply Pagination on post
- Add Pagination in custom loop
- Custom Post Type Pagination For Genesis Child Theme [closed]
- Modifying previous_posts link to use AJAX
- How to remove post duplicate when using query_posts(‘offset=1’)
- paginate_links with select option
- Separate page for pagination possible?
- Why does WordPress keep directing or forcing my pagination?