-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
executable file
·107 lines (94 loc) · 3.32 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
106
107
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Lauch
*/
get_header();
?>
<?php
$blog = get_option( 'page_for_posts' ); ?>
<header class="c-page-offcenter-header">
<h1 class="c-page-title"><?php echo get_the_title($blog); ?></h1>
<div class="c-page-excerpt"><?php echo get_post($blog)->post_content; ?></div>
</header>
<section class="c-blog-list is-feature js-sticky-container">
<div class="feature">
<?php
$sticky = get_option( 'sticky_posts' );
$args_sticky = array('post__in' => $sticky,
'posts_per_page' => 1);
$the_query_sticks = new WP_Query( $args_sticky ); ?>
<?php if ( $the_query_sticks->have_posts() ) : ?>
<?php while ( $the_query_sticks->have_posts() ) : $the_query_sticks->the_post(); ?>
<?php get_template_part( 'template-parts/content', 'teaser'); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
</div>
<ul>
<?php
$args1 = array('post__not_in' => $sticky,
'posts_per_page' => 3);
$the_query = new WP_Query( $args1 ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<li>
<?php get_template_part( 'template-parts/content', 'teaser'); ?>
</li>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif ?>
</ul>
</section>
<section class="c-catnav c-catnav--light" id="kategorien">
<h2 class="c-catnav-title"><?php echo _('Alles zum Thema', 'lauch'); ?></h2>
<nav>
<div class="tns-controls">
<button class="tns-prev" title="Nach links"><?php render_svg('/images/icons/arrow-left.svg'); ?></button>
<button class="tns-next" title="Nach rechts"><?php render_svg('/images/icons/arrow-right.svg') ?></button>
</div>
<ul class="js-slider" data-slider-preset="auto">
<?php $terms = get_terms( array(
'taxonomy' => 'category',
'hide_empty' => true,
) );
foreach ($terms as $term): ?>
<li class="c-catnav-item">
<a href="<?php echo get_term_link($term->slug, $term->taxonomy ); ?>"
title="Alle Posts zu <?php echo $term->name ?>"
class="hover-line-trigger">
<h3><span class="hover-line"><?php echo $term->name; ?></span></h3>
<p><?php echo $term->description; ?></p>
</a>
</li>
<?php endforeach; ?>
</ul>
</nav>
</section>
<section class="c-blog-list is-grid">
<?php
$args2 = array('post__not_in' => $sticky,
'posts_per_page' => 999,
'offset' => 3);
$the_query2 = new WP_Query( $args2 ); ?>
<?php if ( $the_query2->have_posts() ) : ?>
<ul>
<?php while ( $the_query2->have_posts() ) : $the_query2->the_post(); ?>
<li>
<?php get_template_part( 'template-parts/content', 'teaser'); ?>
</li>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</ul>
<?php endif; ?>
</section>
<?php
get_footer();