Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @package WordPress
- * @subpackage Default_Theme
- */
- get_header();
- ?>
- <?php $queried_category = get_term( get_query_var('cat'), 'category' ); ?>
- <?php $categoryValue = get_field('feature_in_category'); ?>
- <section class="section-header-title category-<?php echo $queried_category->slug; ?> ">
- <div class="row">
- <div class="small-12 columns">
- <?php if (have_posts()) : ?>
- <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
- <?php /* If this is a category archive */ if (is_category()) { ?>
- <h2 class="pagetitle"><?php printf(__('%s', 'kubrick'), single_cat_title('', false)); ?></h2>
- <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
- <h2 class="pagetitle"><?php printf(__('Posts Tagged ‘%s’', 'kubrick'), single_tag_title('', false) ); ?></h2>
- <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
- <h2 class="pagetitle"><?php printf(_c('%s', 'kubrick'), get_the_time(__('F jS, Y', 'kubrick'))); ?></h2>
- <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
- <h2 class="pagetitle"><?php printf(_c('%s', 'kubrick'), get_the_time(__('F, Y', 'kubrick'))); ?></h2>
- <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
- <h2 class="pagetitle"><?php printf(_c('%s', 'kubrick'), get_the_time(__('Y', 'kubrick'))); ?></h2>
- <?php /* If this is an author archive */ } elseif (is_author()) { ?>
- <h2 class="pagetitle"><?php _e('Author Archive', 'kubrick'); ?></h2>
- <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
- <h2 class="pagetitle"><?php _e('Blog Archives', 'kubrick'); ?></h2>
- <?php } ?>
- <span class="header-breadcrumb">
- <?php the_breadcrumb(); ?>
- </span>
- </div>
- </div>
- </section>
- <section class="main-content">
- <div class="row collapse">
- <div class="small-12 large-9 columns">
- <div class="row collapse">
- <div class="small-12 large-12 columns">
- <?php
- // args
- $args = array(
- //'numberposts' => -1,
- 'cat' => $categoryValue,
- 'orderby'=> 'modified',
- 'posts_per_page' => 1
- );
- // get results
- $the_query = new WP_Query( $args );
- // The Loop
- ?>
- <?php if( $the_query->have_posts() ): ?>
- <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
- <div class="small-6 columns">
- <div class="img-box-shadow">
- <a href="<?php the_permalink(); ?>">
- <?php echo the_post_thumbnail(); ?>
- </a>
- </div>
- </div>
- <div class="small-6 columns">
- <h3><a href="<?php the_permalink(); ?>"><?php echo the_title(); ?></a></h3>
- <p><?php echo the_excerpt(); ?></p>
- </div>
- <?php endwhile; ?>
- <?php else : echo '<p style="color:#fff;">no posts</p>'; ?>
- <?php endif; ?>
- <?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
- <div class="clearboth"></div>
- </div>
- </div>
- <br />
- <?php while (have_posts()) : the_post(); ?>
- <div class="small-12 medium-4 large-4 columns">
- <div <?php //post_class(); ?> class="category-article-block">
- <a href="#">
- <div class="category-article-thumbnail">
- <div class="view third-effect">
- <?php the_post_thumbnail(); ?>
- <div class="mask">
- <a href="<?php the_permalink() ?>" class="info" title="View Article"><i class="fa fa-search"></i></a>
- </div>
- <div class="category-label"><?php single_cat_title( '', true ); ?></div>
- <!-- <i class="category-label-end"></i> -->
- </div>
- </div>
- </a>
- <div class="category-article-content">
- <h5 class="category-article-title" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('%s'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h5>
- <small><?php //the_time(__('l, F jS, Y', 'kubrick')) ?></small>
- <div class="category-article-excerpt">
- <?php //the_excerpt() ?>
- </div>
- <!-- <p class="postmetadata"><?php the_tags(__('Tags:', 'kubrick'), ', ', '<br />'); ?> <?php printf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?> | <?php edit_post_link(__('Edit', 'kubrick'), '', ' | '); ?> <?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?></p> -->
- <!-- <p class="postmetadata"><?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?></p> -->
- <div class="article-stats-info">
- <ul>
- <!-- <li><?php //the_author(); ?></li> -->
- <li><i class="fa fa-clock-o"></i> <?php the_date('Y-m-d') ?></li>
- <li><i class="fa fa-comments"></i> <?php comments_number( '0 comments', '1 comment', '% comments' ); ?></li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <?php endwhile; ?>
- <?php wpbeginner_numeric_posts_nav(); ?>
- <?php else :
- if ( is_category() ) { // If this is a category archive
- printf("<h2 class='center'>".__("Sorry, but there aren't any posts in the %s category yet.", 'kubrick').'</h2>', single_cat_title('',false));
- } else if ( is_date() ) { // If this is a date archive
- echo('<h2>'.__("Sorry, but there aren't any posts with this date.", 'kubrick').'</h2>');
- } else if ( is_author() ) { // If this is a category archive
- $userdata = get_userdatabylogin(get_query_var('author_name'));
- printf("<h2 class='center'>".__("Sorry, but there aren't any posts by %s yet.", 'kubrick')."</h2>", $userdata->display_name);
- } else {
- echo("<h2 class='center'>".__('No posts found.', 'kubrick').'</h2>');
- }
- get_search_form();
- endif;
- ?>
- </div>
- <div class="small-3 hide-for-small-only columns">
- <?php if ( is_active_sidebar( 'category_sidebar' ) ) : ?>
- <div id="secondary" class="widget-area posts-sidebar" role="complementary">
- <?php dynamic_sidebar( 'category_sidebar' ); ?>
- </div>
- <?php endif; ?>
- </div>
- </div>
- </div>
- </section>
- <?php //get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement