Advertisement
scarletsmoke

blog-template.php

May 4th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.25 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Blog
  4. */
  5. get_header(); ?>
  6.  
  7. <?php if ( $GLOBALS['ghostpool_page_header'] == 'gp-fullwidth-page-header' OR $GLOBALS['ghostpool_page_header'] == 'gp-full-page-page-header' ) { ghostpool_page_header( get_the_ID() ); } ?>
  8.  
  9. <div id="gp-content-wrapper" class="gp-container">
  10.  
  11.     <?php if ( $GLOBALS['ghostpool_page_header'] == 'gp-large-page-header' ) { ghostpool_page_header( get_the_ID() ); } ?>
  12.  
  13.     <div id="gp-inner-container">
  14.  
  15.         <div id="gp-left-column">
  16.    
  17.             <div id="gp-content">
  18.                            
  19.                 <?php ghostpool_breadcrumbs(); ?>
  20.        
  21.                 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  22.  
  23.                     <?php if ( $GLOBALS['ghostpool_title'] == 'enabled' ) { ?> 
  24.                         <header class="gp-entry-header">   
  25.  
  26.                             <h1 class="gp-entry-title" itemprop="headline">
  27.                                 <?php if ( ! empty( $GLOBALS['ghostpool_custom_title'] ) ) { echo esc_attr( $GLOBALS['ghostpool_custom_title'] ); } else { the_title(); } ?>
  28.                             </h1>
  29.  
  30.                             <?php if ( ! empty( $GLOBALS['ghostpool_subtitle'] ) ) { ?>
  31.                                 <h3 class="gp-subtitle"><?php echo esc_attr( $GLOBALS['ghostpool_subtitle'] ); ?></h3>
  32.                             <?php } ?>
  33.            
  34.                         </header>
  35.                     <?php } ?>
  36.                    
  37.                     <?php the_content(); ?>
  38.        
  39.                 <?php endwhile; endif; rewind_posts(); ?>  
  40.  
  41.                 <?php
  42.                
  43.                 // Load page variables
  44.                 ghostpool_loop_variables();
  45.                 ghostpool_category_variables();
  46.                
  47.                 $gp_args = array(
  48.                     'post_status'         => 'publish',
  49.                     'post_type'           => explode( ',', $GLOBALS['ghostpool_post_types'] ),
  50.                     'tax_query'           => $GLOBALS['ghostpool_tax'],
  51.                     'orderby'             => $GLOBALS['ghostpool_orderby_value'],
  52.                     'order'               => $GLOBALS['ghostpool_order'],
  53.                     'meta_key'            => $GLOBALS['ghostpool_meta_key'],
  54.                     'posts_per_page'      => $GLOBALS['ghostpool_per_page'],
  55.                     'paged'               => $GLOBALS['ghostpool_paged'],
  56.                     'date_query'          => array( $GLOBALS['ghostpool_date_posted_value'], $GLOBALS['ghostpool_date_modified_value'] ),  
  57.                 );
  58.  
  59.                 $gp_query = new wp_query( $gp_args ); ?>
  60.            
  61.                 <div class="gp-blog-wrapper <?php echo sanitize_html_class( $GLOBALS['ghostpool_format'] ); ?>"<?php if ( function_exists( 'ghostpool_data_properties' ) ) { echo ghostpool_data_properties( 'blog-template' ); } ?>>
  62.    
  63.                     <?php if ( $gp_query->have_posts() ) : ?>
  64.            
  65.                         <?php get_template_part( 'lib/sections/filter' ); ?>
  66.                                                        
  67.                         <div class="gp-inner-loop <?php echo sanitize_html_class( ghostpool_option( 'ajax' ) ); ?>">
  68.        
  69.                             <?php if ( $GLOBALS['ghostpool_format'] == 'gp-blog-masonry' ) { ?><div class="gp-gutter-size"></div><?php } ?>
  70.                                
  71.                             <?php while ( $gp_query->have_posts() ) : $gp_query->the_post(); ?>
  72.  
  73.                                 <?php get_template_part( 'post', 'loop' ); ?>
  74.            
  75.                             <?php endwhile; ?>
  76.        
  77.                         </div>
  78.  
  79.                         <?php echo ghostpool_pagination( $gp_query->max_num_pages ); ?>
  80.  
  81.                     <?php else : ?>
  82.  
  83.                         <strong class="gp-no-items-found"><?php esc_html_e( 'No items found.', 'socialize' ); ?></strong>
  84.  
  85.                     <?php endif; wp_reset_postdata(); ?>
  86.            
  87.                 </div>
  88.  
  89.             </div>
  90.  
  91.             <?php get_sidebar( 'left' ); ?>
  92.  
  93.         </div>
  94.    
  95.         <?php get_sidebar( 'right' ); ?>
  96.  
  97.     </div>
  98.    
  99.     <div class="gp-clear"></div>
  100.  
  101. </div>
  102.  
  103. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement