Wordpress Static Front Page Pagination Issue!

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(); ?>

WP 4.4.1 Issue, small write up here: http://www.tommusrhodus.com/wordpress-4-4-1-pagination-bug/

but In your that theme, the load more post working, is there something wrong with my code, and why my theme working locally, any idea!
the issue is only with static front page, when i don’t use static front page then it works.

Read the post and the linked WP Core Trac ticket.