Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Blog: Default Test
- *
- * @package theme
- */
- global $style;
- $blog_style = get_theme_mod( 'content-blog-style', 'default' );
- $style = 'grid-standard' == $blog_style ? 'standard' : 'cover';
- $args = array(
- 'numberposts' => 10,
- 'offset' => 0,
- 'category' => 0,
- 'posts_per_page' => 6,
- 'orderby' => 'date',
- 'order' => 'DESC',
- 'post_status' => 'publish',
- 'suppress_filters' => true
- );
- $posts = get_posts( $args, ARRAY_A );
- get_header(); ?>
- <?php if ( is_single() ) : ?>
- <div <?php echo apply_filters( 'theme_cover', 'page-cover', array( 'size' => 'full' ) ); ?>>
- <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>
- </div>
- <?php endif; ?>
- <div id="primary" class="container">
- <div class="row content-area">
- <?php if ( 'left' == esc_attr( theme_theme_mod( 'content-sidebar-position', 'right' ) ) ) : ?>
- <?php get_sidebar(); ?>
- <?php endif; ?>
- <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">
- <?php if ( 'default' != $posts ) : ?>
- <div class="blog-archive blog-archive--grid" data-columns>
- <?php add_filter( 'excerpt_length', 'theme_short_excerpt_length' ); ?>
- <?php endif; ?>
- <?php while ( have_posts() ) : the_post(); ?>
- <?php
- if ( 'default' == $posts ) :
- get_template_part( 'content' );
- else :
- get_template_part( 'content', 'recent-posts' );
- endif;
- ?>
- <?php endwhile; ?>
- <?php if ( 'default' != $posts ) : ?>
- <?php remove_filter( 'excerpt_length', 'theme_short_excerpt_length' ); ?>
- </div>
- <?php endif; ?>
- <?php get_template_part( 'content', 'pagination' ); ?>
- </main>
- <?php if ( 'right' == esc_attr( get_theme_mod( 'content-sidebar-position', 'right' ) ) ) : ?>
- <?php get_sidebar(); ?>
- <?php endif; ?>
- </div>
- </div>
- <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment