Ajax WordPress Pagination does not Work
-
Hello
I am looking for : Ajax WordPress PaginationI have added below code in index.php
<ul id='PaginationExample'> <li><?php next_posts_link('« Older Entries') ?></li> <li><?php previous_posts_link('Newer Entries »') ?></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 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Ajax WordPress Pagination does not Work’ is closed to new replies.