Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*template name: Shows Page*/
- get_header(); ?>
- <?php nectar_page_header($post->ID); ?>
- <div class="container main-content">
- <div class="row">
- <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
- <?php //the_content(); ?>
- <?php endwhile; endif; ?>
- </div><!--/row-->
- <div class="row">
- <?php $loop = new WP_Query( array( 'post_type' => 'show', 'posts_per_page' => 10, 'order' => 'asc' ) ); ?>
- <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <div class="row">
- <div class="col span_4 centered-text">
- <a href="#"><?php the_post_thumbnail( 'medium' ); ?></a>
- </div>
- <div class="col span_8 col_last">
- <h2><?php the_title(); ?></h2>
- <div class="entry-content">
- <?php the_content(); ?>
- </div>
- </div>
- </div>
- <?php
- // ------------------------------------------
- // This is where I want the recent posts to
- // show up, and it needs to use this field:
- // blog_category_id
- // .. can it also check if there's an ID &
- // display nothing if there isn't?
- // ------------------------------------------ ?>
- <?php
- $blog_category_id = get_field('blog_category_id');
- $posts_page_id = get_option('page_for_posts');
- $posts_page = get_page($posts_page_id);
- $posts_page_title = $posts_page->post_title;
- $posts_page_link = get_page_uri($posts_page_id);
- $recent_posts_title_text = (!empty($options['recent-posts-title'])) ? $options['recent-posts-title'] :'Recent Posts';
- $recent_posts_link_text = (!empty($options['recent-posts-link'])) ? $options['recent-posts-link'] :'View All Posts';
- ?>
- <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>
- <div class="row blog-recent">
- <?php
- // Old array for query_posts not currently in use.
- $recentBlogPosts = array(
- 'cat' => $blog_category_id,
- 'showposts' => 4,
- 'ignore_sticky_posts' => 1,
- 'tax_query' => array(
- array( 'taxonomy' => 'post_format',
- 'field' => 'slug',
- 'terms' => array('post-format-link','post-format-quote'),
- 'operator' => 'NOT IN'
- )
- )
- );
- query_posts('showposts=4&cat='.$blog_category_id.'&ignore_sticky_posts=1');
- if(have_posts()) : while(have_posts()) : the_post(); ?>
- <div class="col span_3">
- <?php //echo $blog_category_id;
- if(get_post_format() == 'video'){
- $video_embed = get_post_meta($post->ID, '_nectar_video_embed', true);
- if( !empty( $video_embed ) ) {
- echo '<div class="video-wrap">' . stripslashes(htmlspecialchars_decode($video_embed)) . '</div>';
- } else {
- nectar_video($post->ID);
- }
- }
- else if(get_post_format() == 'audio'){ ?>
- <div class="audio-wrap">
- <?php nectar_audio($post->ID); ?>
- </div><!--/audio-wrap-->
- <?php }
- else if(get_post_format() == 'gallery'){
- if(MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'second-slide')) {
- nectar_gallery($post->ID);
- }
- else {
- if ( has_post_thumbnail() ) { echo get_the_post_thumbnail($post->ID, 'full', array('title' => '')); }
- }
- }
- else {
- if ( has_post_thumbnail() ) { echo '<a href="' . get_permalink() . '">' . get_the_post_thumbnail($post->ID, 'blog', array('title' => '')) . '</a>'; }
- }
- ?>
- <div class="post-header">
- <h3 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
- <?php the_author_posts_link(); ?> | <?php the_category(', '); ?> | <a href="<?php comments_link(); ?>"><?php comments_number( 'No Comments', 'One Comment ', '% Comments' ); ?></a>
- </div><!--/post-header-->
- <?php the_excerpt(); ?>
- </div><!--/span_3-->
- <?php endwhile; endif; ?>
- <?php wp_reset_query(); ?>
- </div><!--/blog-recent-->
- <?php
- // ------------------------------------------
- // Blog Recent crap ends here
- // ------------------------------------------ ?>
- <div class="clear"></div>
- <div class="divider-border"></div>
- <?php endwhile; ?>
- </div><!--/row-->
- </div><!--/container-->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement