I just finished creating infinite loop for my wordpress blog, It's working great on my local PC( WAMP), but when I put it online (nginx server) its showing POST http://ift.tt/1MZjrBt 500 Internal Server Error
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' ); ?>
<?php
</div>
</div>
</article>
<?php endforeach;
wp_reset_postdata(); ?>
</div> <?php get_sidebar(); ?>
</div></div>
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>
I don't know whats the problem is. It's working great on local PC with WAMP but at online server its showing error. Can anyone please please help me to know what's the problem is? Please help...
Aucun commentaire:
Enregistrer un commentaire