-
Notifications
You must be signed in to change notification settings - Fork 1
/
category-news.php
60 lines (55 loc) · 2.3 KB
/
category-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
50
51
52
53
54
55
56
57
58
59
60
<?php get_header(); ?>
<div class="row dp-flex">
<div class="col-md-9 margin-adjust-5">
<div class="blocks">
<h4 class="tocSectionTitle">News</h4>
<ul class="dp-flex announcement-archive-list">
<?php
global $post;
$articles = get_posts( array(
'posts_per_page' => 10,
'post_type' => 'articles',
'category_name' => 'news'
) );
if ( $articles ) {
foreach ( $articles as $post ) :
setup_postdata( $post );
?>
<li class="announcement-archive-list-item">
<?php
if(get_field('_external_link')) {
$externalLink = get_field('_external_link');
?>
<div class="col-md-9 announcement-archive-list-item-title">
<a href="<?php echo $externalLink; ?>" target="_blank">
<!-- --><?php //the_title(); ?>
</a>
</div>
<div class="col-md-3 announcement-archive-list-item-date">
<?php echo get_the_date('d-m-Y' )?>
</div>
<?php
}
else {
?>
<div class="col-md-9 announcement-archive-list-item-title">
<a href="<?php the_permalink(); ?>">
<?php the_title();?>
</a>
</div>
<div class="col-md-3 announcement-archive-list-item-date">
<?php echo get_the_date('d-m-Y' )?>
</div>
</li>
<?php
}
endforeach;
}
?>
</ul>
</div>
</div>
<div class="col-md-3 blocks margin-r-10">
<?php get_sidebar(); ?>
</div>
</div>