2021-04-29 11:47:25 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The section containing preview of news category posts
|
|
|
|
*
|
|
|
|
* @package arcHIVE-theme
|
|
|
|
* @since arcHIVE-theme 1.0.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
?>
|
2021-04-30 01:12:57 +02:00
|
|
|
|
2022-03-16 13:52:05 +01:00
|
|
|
<section class="category-posts news">
|
2021-04-29 11:47:25 +02:00
|
|
|
<header>
|
2022-03-16 13:52:05 +01:00
|
|
|
<h2> <?php single_term_title( );?></h2>
|
2021-04-29 11:47:25 +02:00
|
|
|
</header>
|
|
|
|
<main class="">
|
2021-04-30 01:12:57 +02:00
|
|
|
<?php $the_query = new WP_Query( array( 'category_name' => 'news', 'posts_per_page' => 6 ) ); ?>
|
|
|
|
<?php if ( $the_query->have_posts() ) : ?>
|
2021-05-03 19:49:25 +02:00
|
|
|
<?php //the loop ?>
|
2021-04-30 01:12:57 +02:00
|
|
|
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
|
|
|
|
<?php //content here ?>
|
2021-04-29 11:47:25 +02:00
|
|
|
<article class="">
|
2021-04-30 01:55:57 +02:00
|
|
|
<?php if ( has_post_thumbnail() ) :?>
|
|
|
|
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
|
|
|
|
<figure style="background-image: url(<?php echo get_the_post_thumbnail_url();?>);">
|
|
|
|
</figure>
|
|
|
|
</a>
|
|
|
|
<?php else :?>
|
|
|
|
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
|
|
|
|
<figure style="background-image: url(<?php echo catch_post_first_image();?>);">
|
|
|
|
</figure>
|
|
|
|
</a>
|
|
|
|
<?php endif;?>
|
2021-05-03 14:35:36 +02:00
|
|
|
<h5 class="date">
|
2021-06-28 16:24:49 +02:00
|
|
|
<?php //the_date('d.m.Y');?>
|
2021-05-03 14:35:36 +02:00
|
|
|
</h5>
|
2021-04-30 01:12:57 +02:00
|
|
|
<h3 class="entry-title">
|
|
|
|
<a href="<?php the_permalink(); ?>" rel="bookmark">
|
|
|
|
<?php the_title(); ?>
|
|
|
|
</a>
|
|
|
|
</h3>
|
2021-05-03 19:49:25 +02:00
|
|
|
<section class="excerpt post-excerpt">
|
|
|
|
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
|
|
|
|
<?php the_excerpt() ?>
|
2021-04-30 01:55:57 +02:00
|
|
|
</a>
|
2021-05-03 19:49:25 +02:00
|
|
|
</section>
|
2021-04-29 11:47:25 +02:00
|
|
|
</article>
|
2021-04-30 01:12:57 +02:00
|
|
|
<?php endwhile; ?>
|
|
|
|
<?php // end of the loop ?>
|
|
|
|
<?php //pagination here ?>
|
|
|
|
<?php wp_reset_postdata(); ?>
|
|
|
|
<?php else : ?>
|
|
|
|
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
2021-04-29 11:47:25 +02:00
|
|
|
</main>
|
|
|
|
<aside>
|
|
|
|
<nav>
|
2021-04-30 01:38:35 +02:00
|
|
|
<!--a href="" class="button hollow">see more news</a-->
|
2021-04-29 11:47:25 +02:00
|
|
|
</nav>
|
|
|
|
</aside>
|
|
|
|
</section>
|
|
|
|
|