I am trying to post to the loop.php template file and it is not going through for some reason, usually it should work but it isnt. Is there a alternative way to get this done?
This is what I have in the index.php file of the theme.
$('.load_more_cont a').live('click', function(e) {
leftwrapper = 'THIS IS WORKING';
$.ajax({
url: "<?php bloginfo('template_url') ?>/loop.php",
type:'POST',
data: "left_wrapper=leftwrapper",
success: function(data){
console.log('successful call');
}
});
});
This is what I have in the loop.php file.
$left_wrapper = $_POST['left_wrapper'];
$args = array(
'post_type' => 'post',
'posts_per_page' => 15,
'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1)
);
query_posts($args);
$x = 0;
$leftside = (!isset($left_wrapper) ? '3' : $left_wrapper);
while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php $x++; ?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>