how to make wordpress posts loop and replace the html output using jquery?

efearg07

New Member
In my wordpress site, I have a page that has 3 sections. Every section contains posts from a specific category. I use this wordpress query to get the latest 3 posts in that category and load it in it's section(div). So, for "Novels" section, I use this query:\[code\]<? $novels = get_option('of_novels') ?><?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('category_name=$novels&posts_per_page=3'); ?><?php while (have_posts()) : the_post(); ?> <div class="sliderunit"> <?php the_post_thumbnail(); ?> <div class="novelsslidertitle"> <div class="arrow-left"></div> <a href="http://stackoverflow.com/questions/15872924/<?php the_permalink(); ?>"><img class="cross" src="http://stackoverflow.com/questions/15872924/<?php bloginfo('stylesheet_directory'); ?>/images/cross.png"/></a> <a href="http://stackoverflow.com/questions/15872924/<?php the_permalink(); ?>"><?php the_title(); ?></a> <h3>?????</h3> </div> </div> <?php endwhile;?>\[/code\]and that gets me the latest 3 posts in #novels category. Now, I have some buttons. I want to write some jequery to loop on this category and get previous and next posts, and reloads the new queries content to that #novels div, replacing the old query code in the html using\[code\]$("<div/>").replaceWith("// Replace with a function to get the code of new output");\[/code\]to act as a slider without using pagination and reloading the page? I hope my problem is well declared, I appreciate any helpful clues, links or references.
 
Top