Wordpress static front page pagination working fine on localhost.
but when i uploaded the to server online its not working.
i am using infinite scroll.
the issue is only with static front page, when i don’t use static front page then it works.
here is my code, help will be really appreciated!
<?php
/*
Template Name: Layout 1
*/
?>
<?php get_header(); ?>
<?php
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
else { $paged = 1; }
$args = array('post_type' => 'portfolio', 'posts_per_page' => 3, 'paged' => $paged );
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query( $args );
while ($wp_query->have_posts()) : $wp_query->the_post();
?>
<?php endwhile; ?>
<?php next_posts_link(__('')) ?>
<?php
$wp_query = null;
$wp_query = $temp;
?>
<?php get_footer(); ?>