-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
105 lines (78 loc) · 2.21 KB
/
index.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php get_header(); ?>
<?php if(is_front_page()){
if ( !is_paged() ) {
// Show Latest/Newest Post
if( esc_attr( get_theme_mod( 'mota_home_header' ) == 0 ) ) {
?>
<?php
$args = array(
'posts_per_page' => 1,
'ignore_sticky_posts' => 1
);
$wp_query = new WP_Query( $args );
while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<?php get_template_part( 'template-parts/post/content','special_teaser' ); ?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
<?php
// Show Latest/Newest Sticky-Post
} elseif( esc_attr( get_theme_mod( 'mota_home_header' ) ) == 1 ) {
$sticky = get_option( 'sticky_posts' );
$args = array(
'posts_per_page' => 1,
'post__in' => $sticky,
'ignore_sticky_posts' => 1
);
$query = new WP_Query( $args );
if ( isset($sticky[0]) ) {
?>
<?php get_template_part( 'template-parts/post/content','special_teaser' ); ?>
<?php
}
// Show Nothing -> Invisible
} else {
}
}
} ?>
<section class="article-list">
<div class="innerwidth">
<div class="column__wrapper">
<?php
if(!empty($paged)) {
$paged = $paged;
}elseif(get_query_var( 'paged')) {
$paged = get_query_var('paged');
}elseif(get_query_var( 'page')) {
$paged = get_query_var('page');
}else {
$paged = 1;
} ?>
<?php
if( esc_attr( get_theme_mod( 'mota_home_header' ) == 0 ) ) {
$args = array(
'ignore_sticky_posts' => 1,
'paged' => $paged,
'offset' => 1
);
} else {
$args = array(
'ignore_sticky_posts' => 1,
'paged' => $paged
);
}
$wp_query = new WP_Query( $args );
while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<?php get_template_part( 'template-parts/post/content','three_column' ); ?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</div>
<?php
the_posts_pagination( array(
'prev_text' => __( 'Previous page', 'mota' ),
'next_text' => __( 'Next page', 'mota' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'mota' ) . ' </span>',
) );
?>
</div>
</section>
<?php get_footer(); ?>