Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 95884

soumyaunknown@gmail.com on "Ajax WordPress Pagination does not Work"

$
0
0

Hello
I am looking for : Ajax WordPress Pagination

I have added below code in index.php

<ul id='PaginationExample'>
  <li><?php next_posts_link('&laquo; Older Entries') ?></li>
  <li><?php previous_posts_link('Newer Entries &raquo;') ?></li>
  </ul>

And also added below JS on header.php

<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function(){
jQuery('#PaginationExample a').live('click', function(e){
  e.preventDefault();
  var link = jQuery(this).attr('href');
  jQuery('#contentWrap').html('Loading...');
  jQuery('#contentWrap').load(link+' #content');  

  });  

  });
  </script><p></p>

My Index div Structure

<?php get_header(); ?>
<div id="contentWrap">
<div id="content">

where div#content containing only main Contents (excluding any type of sidebar etc)

PS: I am new in JQuery

It seems does not work,page are still loading with Refresh.

Whats wrong with my code?

Any Solution?

Thank you


Viewing all articles
Browse latest Browse all 95884

Trending Articles