Im loading post into a content area via ajax but the latest post is the only one that loads, any one encounter this and manage to fixed it, if so please enlighten me.
<div class="content">
<?php $args = array('posts_per_page' => 1); query_posts($args);?>
<?php while ( have_posts() ): the_post(); ?>
<div id="inner">
<h2 class="title">
<?php the_title(); ?>
</h2>
<?php the_post_thumbnail(array(150, 150, true)); ?>
<?php the_content(); ?>
</div>
<div class="clear"></div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</div>
its not my ajax script because I get the same result every time, and yes single.php is present but im not using it in anyway.
The javascript
var $mainContent = jQuery(".content"),
siteUrl = "http://" + top.location.host.toString(),
url = '';
jQuery(document).delegate("a[href^='"+siteUrl+"']:not([href*=/wp-admin/]):not([href*=/wp-login.php]):not([href$=/feed/])", "click", function() {
location.hash = this.pathname;
return false;
});
jQuery(window).bind('hashchange', function(){
url = window.location.hash.substring(1);
if (!url) {
return;
}
url = url + " #inner";
$mainContent.slideUp('slow').load(url, function() {
$mainContent.slideDown('slow');
});
});
jQuery(window).trigger('hashchange');
The links to load for ajax
<!--Slide -->
<div id="slider" class="clearfix">
<ul id="roundabout" class="clearfix">
<?php while (have_posts()): the_post(); ?>
<li><a href="<?php the_permalink();?>"><?php the_post_thumbnail(array(150, 150, true));?></a></li>
<?php endwhile; ?>
</ul>
<a id="left" href="#">Left</a>
<a id="right" href="#">Right</a>
</div>
<!-- End #slider -->