1. <?php
  2. /**
  3.  * The main template file.
  4.  *
  5.  * This is the most generic template file in a WordPress theme
  6.  * and one of the two required files for a theme (the other being style.css).
  7.  * It is used to display a page when nothing more specific matches a query.
  8.  * E.g., it puts together the home page when no home.php file exists.
  9.  * Learn more: http://codex.wordpress.org/Template_Hierarchy
  10.  *
  11.  * @package Spun
  12.  * Modification: Custom Circles
  13.  */
  14.  
  15. /* Custom Circle mod */
  16. $custom_circle_args = array(
  17.         'post_type' => 'custom_circles'
  18. );
  19. $custom_circles = new WP_Query( $custom_circle_args );
  20.  
  21. get_header(); ?>
  22.  
  23.         <div id="primary" class="content-area">
  24.             <div id="content" class="site-content" role="main">
  25.             <?php if ( is_home() && ! is_paged() ) : ?>
  26.                 <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
  27.             <?php endif; ?>
  28.             <?php if ( have_posts() ) : ?>
  29.  
  30.                 <?php /* Start the Loop */ ?>
  31.  
  32.                 <?php while ( have_posts() ) : the_post(); ?>
  33.  
  34.                     <?php
  35.                         /* Include the Post-Format-specific template for the content.
  36.                          * If you want to overload this in a child theme then include a file
  37.                          * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  38.                          */
  39.                         get_template_part( 'content', 'home' );
  40.                     ?>
  41.  
  42.                 <?php endwhile; ?>
  43.  
  44.                                 <?php if ( $custom_circles->post_count > 0 ): ?>
  45.  
  46.                                     <?php get_template_part( 'content', 'custom-circles' ); ?>
  47.                                
  48.                                 <?php endif; ?>
  49.                                
  50.                 <?php spun_content_nav( 'nav-below' ); ?>
  51.  
  52.                         <?php elseif ( $custom_circles->post_count > 0 ) : ?>
  53.                            
  54.                               <?php get_template_part( 'content', 'custom-circles' ); ?>
  55.                              
  56.             <?php elseif ( current_user_can( 'edit_posts' ) ) : ?>
  57.  
  58.                 <?php get_template_part( 'content', 'none' ); ?>
  59.  
  60.             <?php endif; ?>
  61.  
  62.             </div><!-- #content .site-content -->
  63.         </div><!-- #primary .content-area -->
  64.  
  65. <?php get_sidebar(); ?>
  66. <?php get_footer(); ?>