I'm using WordPress as a Facebook platform and have a page that shows posts from 2 different categories. Each category has it's own pagination using wp-pagenavi. In order to stay in Facebook I need the pagination links to load using ajax.

I've seen this article which gives a nice clue about it, but would love to know if anyone had already solved this and has any leads.

My main issue here (and this is stupid), I get that I need to call an ajax function with jQuery and pass it the specific category and the desired page number. I have no idea how to get the page number.

But once again, if you have an already made solution - it will be much appreciated

Currently I tried using this tutorial, the tab code can be seen here. as you can see pagination affects both categories :-(

  • 1
    A easy and fake way to do this is to fire a $.ajax request on the navigation link click event, using the link's own href as URL; then get the "content" div from the results and replace it in the current page. I think that "Ajaxed wordpress" plugin does this – onetrickpony Apr 25 '11 at 19:54
  • this is what I've done currently. but it paginates both categories. – hannit cohen Apr 25 '11 at 20:00
  • Pagination links come up wrong and you are using a custom query so it must be something with your code either the query or the pagination links, add your code and we'll be able to help you better. – Bainternet Apr 26 '11 at 19:32

Take a look at this tutorial: http://www.wpmods.com/easily-ajax-wordpress-pagination

  • I was just about to post "use Jquery .load() :) – Bainternet Apr 26 '11 at 0:05
  • This is exactly what I did which resulted with loading both categories content. – hannit cohen Apr 26 '11 at 4:08
  • Maybe I'm not following you completely. You have a page with paginated posts from two different categories. When you click over to the 2nd page, though, it's only supposed to show one category? Do both categories have their own separate page navigators? – Pippin Apr 26 '11 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.