Advertisement
arif11015

Untitled

Jul 28th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. Template Name: frontpage
  5.  */
  6. get_header();?>
  7.  
  8.  
  9.                 <?php
  10.                     $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
  11.                     $args = array(
  12.                       'post_type' => 'post',
  13.                       'posts_per_page' => 2,
  14.                       'post_status'   => 'publish',
  15.                       'paged'          => $paged
  16.                     );
  17.                     $query = new WP_Query( $args );            
  18.                 ?>
  19.  
  20.                
  21.                     <?php while( $query->have_posts()) : $query->the_post();?>             
  22.                         <?php the_post_thumbnail('single-blog-image', array('class' => 'single_blog_image')); ?>
  23.                         <?php the_title();?>                                               
  24.                         <?php the_excerpt();?>                 
  25.                     <?php endwhile;?>
  26.                     <?php wp_reset_postdata(); ?>
  27.                    
  28.                    
  29.                    
  30.                    
  31.                         <?php
  32.                         echo paginate_links(array(
  33.                             'total' => $query->max_num_pages,
  34.                             'curent' => $paged
  35.                         ));
  36.                        
  37.                         ?>
  38.                    
  39.  
  40.  
  41. <?php
  42. get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement