-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
118 lines (102 loc) · 3.48 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
108
109
110
111
112
113
114
115
116
117
118
<?php
/**
* The main template file.
*
* @package WordPress
* @subpackage FAU
* @since FAU 1.0
*/
if (isset($_GET['format']) && $_GET['format'] == 'embedded') {
get_template_part('template-parts/index', 'embedded');
return;
}
if ( is_active_sidebar( 'news-sidebar' ) ) {
fau_use_sidebar(true);
}
get_header();
$posttype = get_post_type();
$screenreadertitle = '';
$herotype = get_theme_mod('advanced_header_template');
if (($posttype == 'post') && (is_archive())) {
if (is_category()) {
$screenreadertitle = single_cat_title("", false);
} else {
$screenreadertitle = get_the_archive_title();
}
} else {
$screenreadertitle = __('Index','fau');
}
$titleforscreenreader = true;
if (empty($herotype)) {
$titleforscreenreader = true;
$herotype = 'default';
} elseif (($herotype=='banner') || ($herotype=='slider')) {
$titleforscreenreader = false;
}
?>
<div id="content" class="herotype-<?php echo $herotype; ?>">
<div class="content-container">
<div class="post-row">
<?php if(get_post_type() == 'post') { ?>
<main class="entry-content">
<?php } else { ?>
<main>
<?php }
if ($titleforscreenreader) { ?>
<h1 id="maintop" class="mobiletitle"><?php echo $screenreadertitle; ?></h1>
<?php } else { ?>
<h1 id="maintop" ><?php echo $screenreadertitle; ?></h1>
<?php }
$line=0;
while ( have_posts() ) {
the_post();
$line++;
if ($posttype == 'person') {
echo FAU_Person_Shortcodes::fau_person(array("id"=> $post->ID, 'format' => 'kompakt', 'showlink' => 0, 'showlist' => 1 ));
} elseif($posttype == 'post') {
echo fau_display_news_teaser($post->ID,true);
} else { ?>
<h2 class="small"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php if(has_post_thumbnail( $post->ID )) { ?>
<div class="row">
<div class="span3">
<?php
$post_thumbnail_id = get_post_thumbnail_id( $post->ID);
echo fau_get_image_htmlcode($post_thumbnail_id);
?>
</div>
<div class="span5">
<?php }
the_content();
if(has_post_thumbnail( $post->ID )) { ?>
</div>
</div>
<?php }
}
}
if (($posttype=='person') || ($posttype=='post')) {
$next = get_next_posts_link(__('Ältere Beiträge', 'fau'));
$prev = get_previous_posts_link(__('Neuere Beiträge', 'fau'));
if ($next || $prev) {
echo '<nav class="index-navigation">';
if ($prev) {
echo '<div class="prev">'.$prev.'</div>';
}
if ($next) {
echo '<div class="next">'.$next.'</div>';
}
echo '</nav>';
}
}
?>
</main>
<?php
if($posttype=='post') {
get_template_part('template-parts/sidebar', 'posts');
}
?>
</div>
</div>
</div>
<?php
get_footer();