Site icon Hip-Hop Website Design and Development

Pagination does not work on static entrance web page

Static entrance web page pagination working wonderful on localhost.
however when i uploaded the to server on-line its not working.
i’m utilizing infinite scroll.
the difficulty is simply with static entrance web page, when i do not use static entrance web page then it really works.
right here is my code, assist shall be actually appreciated!

<?php
/*
Template Title: Format 1 
*/
?>
<?php get_header(); ?>

<div class="major">


  <div class="container">
  <div class="sixteen columns">
  <div class="portfolio-all-main">


<?php 
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('web page') ) { $paged = get_query_var('web 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->question( $args );

   whereas ($wp_query->have_posts()) : $wp_query->the_post();
?>    



   <div class="portfolio-itemv2">
     <div class="pfolio-item-fixer">

                <a href="<?php the_permalink(); ?>" rel="bookmark" title="Everlasting Hyperlink to <?php the_title_attribute(); ?>">

               <?php the_post_thumbnail(''); ?>
         </a>
        </div>


        <div class="pwhites">
            <h2 class="portfolio-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Everlasting Hyperlink to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
        </div>
        </div>


        <?php endwhile; ?>        
                    <div class="pagi">
<div id="page-nav"><?php next_posts_link(__('')) ?></div>

            </div>
<?php
  $wp_query = null;
  $wp_query = $temp;
?>
         <div class="clear"></div>
        </div></div>

          </div>  </div>
<script>
  $(operate(){

    var $container = $('.portfolio-all-main');

    $container.imagesLoaded(operate(){
      $container.masonry({
        itemSelector: '.portfolio-itemv2'

      });
    });

    $container.infinitescroll({
      navSelector  : '#page-nav',    // selector for the paged navigation 
      nextSelector : '#page-nav a',  // selector for the NEXT hyperlink (to web page 2)
      itemSelector : '.portfolio-itemv2',     // selector for all objects you may retrieve
      loading: {
          finishedMsg: '',
          img: '<?php echo get_template_directory_uri(); ?>/pictures/ajax-loader.gif'
        }
      },
      // set off Masonry as a callback
      operate( newElements ) {
        // cover new objects whereas they're loading
        var $newElems = $( newElements ).css({ opacity: 0 });
        // be sure that pictures load earlier than including to masonry format
        $newElems.imagesLoaded(operate(){
          // present elems now they're prepared
          $newElems.animate({ opacity: 1 });
          $container.masonry( 'appended', $newElems, true ); 
        });
      }
    );

  });
</script>        

<?php get_footer(); ?>