Advertisement
Guest User

Untitled

a guest
Jan 8th, 2014
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.58 KB | None | 0 0
  1. <?php
  2. /*template name: Shows Page*/
  3. get_header(); ?>
  4.  
  5. <?php nectar_page_header($post->ID); ?>
  6.  
  7. <div class="container main-content">
  8.    
  9.     <div class="row">
  10.  
  11.         <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
  12.            
  13.             <?php //the_content(); ?>
  14.  
  15.         <?php endwhile; endif; ?>  
  16.  
  17.     </div><!--/row-->
  18.     <div class="row">
  19.  
  20.         <?php $loop = new WP_Query( array( 'post_type' => 'show', 'posts_per_page' => 10, 'order' => 'asc' ) ); ?>
  21.  
  22.         <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
  23.  
  24.             <div class="row">
  25.                 <div class="col span_4 centered-text">
  26.                     <a href="#"><?php the_post_thumbnail( 'medium' ); ?></a>
  27.                 </div>
  28.  
  29.                 <div class="col span_8 col_last">
  30.                     <h2><?php the_title(); ?></h2>
  31.  
  32.                     <div class="entry-content">
  33.                         <?php the_content(); ?>
  34.                     </div>
  35.                 </div>
  36.             </div>
  37.  
  38.             <?php
  39.             // ------------------------------------------
  40.             // This is where I want the recent posts to
  41.             // show up, and it needs to use this field:
  42.             // blog_category_id
  43.             // .. can it also check if there's an ID &
  44.             // display nothing if there isn't?
  45.             // ------------------------------------------ ?>
  46.  
  47.             <?php
  48.                 $blog_category_id = get_field('blog_category_id');
  49.  
  50.                 $posts_page_id = get_option('page_for_posts');
  51.                 $posts_page = get_page($posts_page_id);
  52.                 $posts_page_title = $posts_page->post_title;
  53.                 $posts_page_link = get_page_uri($posts_page_id);
  54.                
  55.                 $recent_posts_title_text = (!empty($options['recent-posts-title'])) ? $options['recent-posts-title'] :'Recent Posts';      
  56.                 $recent_posts_link_text = (!empty($options['recent-posts-link'])) ? $options['recent-posts-link'] :'View All Posts';   
  57.             ?>
  58.            
  59.             <h2 class="uppercase"><?php //echo $recent_posts_title_text; ?>Recent Episodes <a href="<?php echo $posts_page_link; ?>" class="button"> <!-- / --> <?php //echo $recent_posts_title_text; ?> </a></h2>
  60.            
  61.             <div class="row blog-recent">
  62.                
  63.                 <?php
  64.                             // Old array for query_posts not currently in use.
  65.                 $recentBlogPosts = array(
  66.                     'cat' => $blog_category_id,
  67.                     'showposts' => 4,
  68.                     'ignore_sticky_posts' => 1,
  69.                     'tax_query' => array(
  70.                         array( 'taxonomy' => 'post_format',
  71.                             'field' => 'slug',
  72.                             'terms' => array('post-format-link','post-format-quote'),
  73.                             'operator' => 'NOT IN'
  74.                         )
  75.                     )
  76.                 );
  77.  
  78.                 query_posts('showposts=4&cat='.$blog_category_id.'&ignore_sticky_posts=1');
  79.                
  80.                 if(have_posts()) : while(have_posts()) : the_post(); ?>
  81.                
  82.                 <div class="col span_3">
  83.                    
  84.                     <?php //echo $blog_category_id;
  85.                    
  86.                         if(get_post_format() == 'video'){
  87.                              $video_embed = get_post_meta($post->ID, '_nectar_video_embed', true);
  88.                    
  89.                             if( !empty( $video_embed ) ) {
  90.                                 echo '<div class="video-wrap">' . stripslashes(htmlspecialchars_decode($video_embed)) . '</div>';
  91.                             } else {
  92.                                 nectar_video($post->ID);
  93.                             }
  94.                         }
  95.                        
  96.                         else if(get_post_format() == 'audio'){ ?>
  97.                             <div class="audio-wrap">       
  98.                                 <?php nectar_audio($post->ID); ?>
  99.                             </div><!--/audio-wrap-->
  100.                         <?php }
  101.                        
  102.                         else if(get_post_format() == 'gallery'){
  103.                            
  104.                             if(MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'second-slide')) {
  105.                                 nectar_gallery($post->ID);
  106.                             }
  107.                            
  108.                             else {
  109.                                 if ( has_post_thumbnail() ) { echo get_the_post_thumbnail($post->ID, 'full', array('title' => '')); }
  110.                             }
  111.                                    
  112.                         }
  113.                        
  114.                         else {
  115.                             if ( has_post_thumbnail() ) { echo '<a href="' . get_permalink() . '">' . get_the_post_thumbnail($post->ID, 'blog', array('title' => '')) . '</a>'; }
  116.                         }
  117.                    
  118.                     ?>
  119.    
  120.                     <div class="post-header">
  121.                         <h3 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>   
  122.                         <?php the_author_posts_link(); ?> | <?php the_category(', '); ?> | <a href="<?php comments_link(); ?>"><?php comments_number( 'No Comments', 'One Comment ', '% Comments' ); ?></a>
  123.                     </div><!--/post-header-->
  124.                    
  125.                     <?php the_excerpt(); ?>
  126.                    
  127.                 </div><!--/span_3-->
  128.                
  129.                 <?php endwhile; endif; ?>
  130.  
  131.                 <?php wp_reset_query(); ?>
  132.        
  133.             </div><!--/blog-recent-->
  134.  
  135.             <?php
  136.             // ------------------------------------------
  137.             // Blog Recent crap ends here
  138.             // ------------------------------------------ ?>
  139.  
  140.             <div class="clear"></div>
  141.             <div class="divider-border"></div>
  142.  
  143.         <?php endwhile; ?>
  144.  
  145.     </div><!--/row-->
  146.    
  147. </div><!--/container-->
  148.  
  149. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement