Guest User

Untitled

a guest
Jan 23rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Blog: Default Test
  4. *
  5. * @package theme
  6. */
  7. global $style;
  8.  
  9. $blog_style = get_theme_mod( 'content-blog-style', 'default' );
  10. $style = 'grid-standard' == $blog_style ? 'standard' : 'cover';
  11. $args = array(
  12. 'numberposts' => 10,
  13. 'offset' => 0,
  14. 'category' => 0,
  15. 'posts_per_page' => 6,
  16. 'orderby' => 'date',
  17. 'order' => 'DESC',
  18. 'post_status' => 'publish',
  19. 'suppress_filters' => true
  20. );
  21.  
  22. $posts = get_posts( $args, ARRAY_A );
  23.  
  24. get_header(); ?>
  25.  
  26. <?php if ( is_single() ) : ?>
  27. <div <?php echo apply_filters( 'theme_cover', 'page-cover', array( 'size' => 'full' ) ); ?>>
  28. <h1 class="page-title cover-wrapper"><?php echo get_option( 'page_for_posts' ) ? get_the_title( get_option( 'page_for_posts' ) ) : _x( 'Blog', 'blog page title', 'theme' ); ?></h1>
  29. </div>
  30. <?php endif; ?>
  31.  
  32. <div id="primary" class="container">
  33. <div class="row content-area">
  34.  
  35. <?php if ( 'left' == esc_attr( theme_theme_mod( 'content-sidebar-position', 'right' ) ) ) : ?>
  36. <?php get_sidebar(); ?>
  37. <?php endif; ?>
  38.  
  39. <main id="main" class="site-main col-xs-12 <?php if ( 'none' != esc_attr( theme_theme_mod( 'content-sidebar-position', 'right' ) ) && is_active_sidebar( 'widget-area-sidebar-1' ) ) : ?>col-sm-7 col-md-8<?php endif; ?>" role="main">
  40.  
  41. <?php if ( 'default' != $posts ) : ?>
  42. <div class="blog-archive blog-archive--grid" data-columns>
  43. <?php add_filter( 'excerpt_length', 'theme_short_excerpt_length' ); ?>
  44. <?php endif; ?>
  45.  
  46. <?php while ( have_posts() ) : the_post(); ?>
  47.  
  48. <?php
  49. if ( 'default' == $posts ) :
  50. get_template_part( 'content' );
  51. else :
  52. get_template_part( 'content', 'recent-posts' );
  53. endif;
  54. ?>
  55.  
  56. <?php endwhile; ?>
  57.  
  58. <?php if ( 'default' != $posts ) : ?>
  59. <?php remove_filter( 'excerpt_length', 'theme_short_excerpt_length' ); ?>
  60. </div>
  61. <?php endif; ?>
  62.  
  63. <?php get_template_part( 'content', 'pagination' ); ?>
  64.  
  65. </main>
  66.  
  67. <?php if ( 'right' == esc_attr( get_theme_mod( 'content-sidebar-position', 'right' ) ) ) : ?>
  68. <?php get_sidebar(); ?>
  69. <?php endif; ?>
  70.  
  71. </div>
  72. </div>
  73.  
  74. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment