Advertisement
TheMightyAnt

JKing - Front-page

May 1st, 2015
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.54 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3.       <div class="media-wall">
  4.      
  5.          <?php // set the "paged" parameter (use 'page' if the query is on a static front page)
  6.          $paged = (get_query_var('page')) ? get_query_var('page') : 1;
  7.          
  8.          // Query Arguments
  9.          $args = array(
  10.             'post_type' => array('post', 'events', 'galleries', 'videos'),
  11.             'posts_per_page' => '11',
  12.             'paged' => $paged
  13.          );
  14.  
  15.             // The Query
  16.             $the_query = new WP_Query( $args );
  17.            
  18.             // The Loop
  19.             if ( $the_query->have_posts() ) :
  20.            
  21.                echo '<ul class="group" id="wall-posts">';
  22.            
  23.                while ( $the_query->have_posts() ) :
  24.                
  25.                   $the_query->the_post();
  26.                  
  27.                   get_template_part( 'content' );  
  28.                  
  29.                 endwhile;
  30.                
  31.                get_template_part( 'includes/tweet' );
  32.                
  33.                echo '</ul>';
  34.                
  35.                
  36.                echo '<div class="next-posts">';
  37.                              
  38.                   next_posts_link( 'load more', $the_query->max_num_pages );
  39.                  
  40.                echo '</div>';
  41.                
  42.             else:
  43.            
  44.                echo '<h2 class="no-posts">There are no news posts</h2>';
  45.    
  46.             endif;
  47.            
  48.             wp_reset_postdata();
  49.            
  50.             ?>
  51.  
  52.       </div>    
  53.  
  54. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement