title: Wordpress Pagination in a Shortcode
body: <p>A quick question for the Wordpress Brains out there ...</p>
  
  <p>Ive got a shortcode which currently imports all posts from a certain post type. However Im having trouble adding pagination to the wp_query. </p>
  
  <p>To explain once this code functions, I put [feed type="attractions" limit="2"] on the page and it displays 2 posts based on attractions, however it doesnt paginate. Just wondering what im doing wrong exactly... </p>
  
  <p>Heres the code! --- ></p>
  
  <pre><code>    function section_feed_shortcode( $atts ) {
      extract( shortcode_atts( array( 'limit' =&gt; -1, 'type' =&gt; 'post'), $atts ) );
  
      $q = new WP_Query(  array ( 'posts_per_page' =&gt; $limit, 'post_type' =&gt; $type, order =&gt; 'ASC', orderby =&gt;'menu_order', 'paged' =&gt; get_query_var('page')  ) );
  
      $list = ' ';
  
      while ( $q-&gt;have_posts() ) { $q-&gt;the_post();
  
          $list .= '&lt;article class="listing-view clearfix"&gt;' 
          . '&lt;div class="listing-content"&gt;' 
          . '&lt;h3&gt;' . get_the_title() . '&lt;/h3&gt;' 
          .'&lt;p&gt;' . get_the_excerpt() . '&lt;/p&gt;'
          . '&lt;a href="' . get_permalink() . '"&gt;' . 'View &amp;raquo;' . '&lt;/a&gt;'
          . '&lt;/div&gt;'
          . '&lt;a class="listing-thumb" href="' . get_permalink() . '"&gt;' . get_the_post_thumbnail($page-&gt;ID, 'listing-thumb')  . '&lt;span&gt;&lt;/span&gt;&lt;/a&gt;'
          . '&lt;/article&gt;';
      }
  
      wp_reset_query();
  
      return 
      '&lt;div class="listings clearfix"&gt;' 
      . $list 
      . '&lt;div class="nav-previous"&gt;' . next_posts_link( __( '&lt;span class="meta-nav"&gt;&amp;larr;&lt;/span&gt; Older posts', 'stratford_wp' ) ) . '&lt;/div&gt;'
      . '&lt;div class="nav-next"&gt;' . previous_posts_link( __( 'Newer posts &lt;span class="meta-nav"&gt;&amp;rarr;&lt;/span&gt;', 'stratford_wp' ) ) . '&lt;/div&gt;'
      . '&lt;/div&gt;';
  }
  add_shortcode( 'feed', 'section_feed_shortcode' );
  </code></pre>
  
  <p>Thanks for answers in advanced!</p>