I am new in WordPress coding and I make one infinity loop for my WordPress blog. Its working great on Local machine (WAMP) but after putting it online at nginx server its showing
POST mysiteurl 500 Internal Server Error
I try to find out the solutions but nothing works for me.. Please someone help me...
Infinite_loop.php
<?php
$infinite_loop= $_POST['pcount']; ?>
<?php require_once("/wp-blog-header.php"); ?>
<div class="x-container-fluid max width main">
<div class="offset cf">
<div class="<?php x_main_content_class(); ?>" role="main">
<?php
global $wpdb;
$args = array( 'posts_per_page' => 10, 'order' => 'DESC', 'offset'=>$infinite_loop );
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div>
<div style="width:300px; float:left;">
<?php x_ethos_featured_index(); ?>
</div>
<div style="width:500px; float:right;">
<?php /* print $args['offset']; */ ?>
<?php x_get_view( 'ethos', '_content', 'post-header' ); ?>
<?php x_get_view( 'global', '_content' ); ?>
</div>
</div>
</article>
<?php endforeach;
wp_reset_postdata(); ?>
AJAX IN THEME HEADER
script>
$(document).ready(function() {
var post_page_count = 10;
var height_scroll = 400;
$(window).scroll(function() {
if ($('body').height() <= ($(window).height() + $(window).scrollTop())){
post_page_count = post_page_count+10;
$.ajax({
type: "POST",
async: false,
url: "theme/infinite_loop.php",
data: {pcount:post_page_count},
success:
function(result){
$("#gizinfi").append(result);
}
});
};
});
});
</script>
Aucun commentaire:
Enregistrer un commentaire