-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontent-news.php
49 lines (37 loc) · 1.39 KB
/
content-news.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* The template for displaying news articles on the front page.
*
* @package _egukbasetheme
*/
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
$args = array(
'cat' => 1,
'ignore_sticky_posts' => 1,
'post__not_in' => get_option( 'sticky_posts' ),
'paged' => $paged,
);
$news = new WP_Query( $args );
if ( $news->have_posts() ) :
while ( $news->have_posts() ) : $news->the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-meta">
<span class="entry-date"><?php echo esc_html( get_the_date('j') ); ?></span>
<span class="entry-month"><?php echo esc_html( get_the_date('M') ); ?></span>
</div><!-- .entry-meta -->
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', '_egukbasetheme' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
</article><!-- #post-<?php the_ID(); ?> -->
<?php endwhile;
endif;
wp_reset_postdata();