ajax pagination in posts – working, but not like it should
-
Hi!
I have a single.php where a post shows up, that is seperated in different pages with
<!--NEXTPAGE-->
I have a pagination like this:<?php wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink= %'); ?>
Ok – the post pages show up correctly with prev & next button at the bottom of the post.
Now I use jquery to load each page in that post with AJAX on click on the page number:
<script type="text/javascript"> $(document).ready(function(){ jQuery('#prevnext_btns a' ).live('click', function(e){ //check when pagination link is clicked and stop its action. e.preventDefault(); var link = jQuery(this).attr('href'); //Get the href attribute jQuery('.article_wrapper').fadeIn(50000, function(){ //fade out the content area jQuery("#loader").show(); // show the loader animation }).load(link + ' .article_wrapper ', function(){ jQuery('.article_wrapper p').fadeIn(0, function(){ //load data from the content area from paginator link page that we just get from the top jQuery("#loader").hide(); //hide the loader }); }); }); }); </script>
Also this works perfectly –
BUT: I can’t get the first link or the “prev” button in the pagination to work. E.g.: number 2, 3, 4, 5, next do work – but prev and 1 are not linked.So how could I fix this?
Thank you very much!
AD
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘ajax pagination in posts – working, but not like it should’ is closed to new replies.