forked from Licoy/wordpress-theme-puock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost-news.php
38 lines (27 loc) · 1.49 KB
/
post-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
<?php
if (is_home()):
if (pk_is_checked('company_news_open')) {
$company_news_cid = pk_get_option('company_news_cid', null);
if ($company_news_cid):
$news = query_posts(array('cat' => (is_array($company_news_cid) ? join(',', $company_news_cid) : $company_news_cid), 'ignore_sticky_posts' => true,
'posts_per_page' => pk_get_option('company_news_max_num', 4), 'orderby' => 'DESC'));
if ($news && count($news) > 0): ?>
<h4 class="text-center"><?php echo pk_get_option('company_news_title') ?></h4>
<div class="pb-0 mt30">
<div class="row puock-text post-relevant">
<?php foreach ($news as $post): setup_postdata($post) ?>
<a <?php pk_link_target() ?> href="<?php the_permalink() ?>"
class="col-6 col-md-3 post-relevant-item">
<!-- --><?php //the_title() ?>
<div style="background:url('<?php echo pk_get_img_thumbnail_src(get_post_images(), 160, 140); ?>')">
<div class="title"><?php the_title(); ?></div>
</div>
</a>
<?php wp_reset_postdata();endforeach; ?>
</div>
</div>
<?php
endif; endif;
wp_reset_query();
}
endif;