An easier approach would be to load N (around 10 maybe) posts at the time and then just slide between them using jQuery, you could output an <a name="POST-ID"> before each one and use some jQuery sliding body plugin to slide to each <a>.
If you’d like to load via ajax or go to a totally new page with browser window refresh you could use the the function:
<?php
function get_adjacent_post( $in_same_cat = false, $excluded_categories="", $previous = true ){
//from wp-includes/link-template.php line 1097
}
$next_post = get_adjacent_post( true, null, false );
?>
to get the next or previous post object which you wil get the post permalink by using:
<?php $permalink = get_permalink( $next_post->ID ); ?>
Hope that helps.
Related Posts:
- Later blog post pages give 404 error
- Show Default Editor on Blog Page ( Administration Panel )
- What is the difference between $paged and $page?
- How to embed page content in a blog post
- Custom Search Page Pagination Not Working
- Get next/previous cousin page
- Is it possible to set a page template on a dynamic home page (articles list)?
- Limit the number of pages created by the paging
- Sitewide page on all the blogs in the network
- How to add pagination to a single wordpress page with lot of text
- How can I get the blog page ID?
- Why won’t pagination work?
- Page Title repeating
- advanced paging in wordpress
- Is there a template tag/function for getting the URL (or slug or name or ID) of the blog page when using a “static” front page
- Displaying the blog entries in a Page (using get_posts to retrieve the posts)?
- Embedding Password Protected (Private) “Blog Posts” BLOCK that shows Images and Excerpts on Password Protected Page (not the home page)
- WordPress blog posts template bug [closed]
- How to publish pages under a subdomain url?
- Add pagination to search.php page
- Pagination For Page Post Type
- Page loads all pages of the image gallery with pagination
- How do I make just one of my pages a Blog Page?
- Paginate Links not working
- pagination does not work with query_posts. Help! [duplicate]
- Show different number of posts on second page of category
- Add tags to long page that is broken up into subpages?
- Site Library issue
- Replace Dashes Before Title in Page List
- WordPress parent select need to be removed
- Limit number of pages that use a specific template?
- How does wordpress calculate the page depth?
- Multiple pages on a single page
- Show TwentyEleven header image only on home page
- Pagination for Pages and Posts
- WordPress post/page pagination (page links) to go back to the first section
- Show different badge based upon the user role
- How to change the permalink structure of a master page?
- Placing google maps into a wordpress page using the wordpress page editor
- Dashboard–> All Pages “How to create folders?”
- Putting footer content in a “page” – Doing it wrong?
- How to create wordpress page that shows posts with specific tags?
- Template for child pages / subpages
- Is there a better way to programmatically insert content into a page?
- Custom page template not working
- How to Add a Rewrite Rule for Only One Page?
- Are Pages the right thing to use for making sections of a single-page site?
- Allow contributors to create page (but not publish)
- add new metabox to page editor with just page parent
- How to setcookie if is_page(‘page’) ? should I use add_action(‘init’) or there is another action?
- Column Images Showing Gaps
- I Changed the Menu Order, But the Page Order Didn’t Change on Front Page
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Page template no longer exists – metaboxes won’t save
- A static page view call every custom page templates
- Wrapping images in tags based on size
- The concept of non-blog content
- Loading Multiple Comments Pages via Ajax?
- Change base URL of pages created by certain users
- Remove Content edit box from ALL pages (not posts)
- What is full URL for a post?
- Edit Parent page drop menu when creating a page
- How to create a page and display only the posts with a specific custom field value?
- Remove comment section from new page
- Manage content on multiple pages synchronysly?
- Print page content with formatting when doing custom SQL query
- Listing all child-pages of a parent-page on the parent-page and each child-page?
- How does wordpress link page templates to individual pages
- Direct some posts to only appear on a specific page
- Archive limit the text of the_content
- Add pagination to this following template
- How to fix broken URL – https://mywebsite.com/comments/feed/
- Can’t find the page that is using a slug
- Create page template
- Cannot Create A Page or Post in WordPress 5.2.1
- When would it be best to hook AJAX functions on a back-end page?
- Get largest page id by title?
- Detecting if I’m on a single, non-post, non-homepage page?
- My AJAX requests take 30 seconds to complete
- display different pages content on single page
- Specify parent page template
- Creating multiple pages
- Create nonce in frontend page to edit profile
- How to make page navigation just below the content?
- Hide if subpages are shown
- Multiple WordPress Pages
- How to create an user defined page?
- How to pass the Querystring in pages?
- paged query leads to 404? [duplicate]
- I have over 3000 child pages – but I need a different main page
- How to enable automatic search results in WordPress
- How to make a conditional statement that checks if the page is the child of a certain page?
- Is it possible to keep the page title from actually appearing at the top of the page?
- Edit the text location of a form
- Missing page on wordpress “Pages” dashboard [closed]
- User profile in front-end
- custom css in one page
- Why is a page shown with ‘hidden’ next to the name in the list of pages if the page is set to public?
- Website content shifted all the way to the left
- Why Does get_page_by_path Return The Sample Post?