-
Notifications
You must be signed in to change notification settings - Fork 0
/
tovabbi_sztorik.php
68 lines (51 loc) · 2.46 KB
/
tovabbi_sztorik.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
61
62
63
64
65
66
67
68
<?php
$excluded_posts=[];
// Get top sztori post
$exclude_topsztori=get_field('top_sztori_cikk');
array_push($excluded_posts, $exclude_topsztori[0]);
// Get dosszie posts
$exclude_dosszie=get_field('dosszie_cikkek');
foreach ($dosszie_cikkek as $dosszie_cikk_id) {
array_push($excluded_posts, $dosszie_cikk_id);
}
$args_tovabbi_1=array(
'posts_per_page' => $tovabbi_sztorik_egyszerre, // 2 was
'offset' => $tovabbi_sztorik_offset,
'post__not_in' => $excluded_posts
);
$the_query_tovabbi_1 = new WP_Query( $args_tovabbi_1 );
$i=1;
?>
<div class="tovabbi_sztorik cle">
<h4 class="title fs16px cgrey ttn fmedium ls2 pt10"><div class="shell"><span class="n9 bl pt5">További sztorik</span></div></h4>
<div class="n100 blgrey">
<?php while ($the_query_tovabbi_1->have_posts() ) : $the_query_tovabbi_1->the_post(); ?><article class="n100 pt50 bl item-<?php echo $i;?>">
<div class="inner n9">
<div class="shell">
<a href="<?php echo get_category_link(get_first_cat_id()); ?>" class="the_category mb20 bl"><?php echo get_first_cat_name();?></a>
<h3 class="the_title ttn mb40"><a href="<?php echo get_permalink();?>" class="cdarkgrey fs48px"><?php the_title();?></a></h3>
<?php
$post_author_id=get_post_field( 'post_author', get_the_ID());
$the_post_date=get_the_date('Y. M. j.');
$the_post_author_name=nl2br(get_the_author_meta('last_name', $post_author_id)." ".get_the_author_meta('first_name', $post_author_id));
if (has_post_thumbnail()) {
?>
<div class="img100 the_featimage n33 ib"><a href="<?php echo get_permalink(); ?>" class="bl fade"><?php the_post_thumbnail('small_169', array('class' => 'pr30')); ?></a></div><div class="n66 the_text ib vt mb30">
<div class="the_excerpt kszoveg cdarkgrey lh140 fs20px ls05 mb30"><?php echo get_the_excerpt(); ?></div>
<div class="author_box cgrey fs12px">
<div class="the_author ib"><?php echo $the_post_author_name; ?></div>
<time class="the_post_date"> — <?php echo $the_post_date; ?></time>
</div>
</div>
<?php } else { ?>
<div class="the_excerpt kszoveg cdarkgrey lh140 fs20px ls05 mb30"><?php echo get_the_excerpt(); ?></div>
<div class="author_box cgrey fs12px">
<div class="the_author ib"><?php echo $the_post_author_name; ?></div>
<time class="the_post_date"> — <?php echo $the_post_date; ?></time>
</div>
<?php } ?>
</div>
</div>
</article><?php $i++; endwhile; wp_reset_postdata(); ?>
</div>
</div>