forked from xwolfde/Piratenkleider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
167 lines (153 loc) · 5.75 KB
/
single.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php get_header();
global $options;
?>
<div class="section content" id="main-content">
<div class="row">
<div class="content-primary">
<?php if ( have_posts() ) while ( have_posts() ) : the_post();
$custom_fields = get_post_custom();
$image_url = '';
$image_alt = '';
$attribs = array(
"credits" => $options['img-meta-credits'],
);
$sliderimage = get_post_meta( get_the_ID(), 'piratenkleider_slider_image', true );
if ($sliderimage) {
$image_url_data = wp_get_attachment_image_src( $sliderimage, 'highslider');
$image_url = $image_url_data[0];
$attribs = piratenkleider_get_image_attributs($sliderimage);
} elseif (has_post_thumbnail()) {
$thumbid = get_post_thumbnail_id(get_the_ID());
$image_url_data = wp_get_attachment_image_src( $thumbid, 'full');
$image_url = $image_url_data[0];
$attribs = piratenkleider_get_image_attributs($thumbid);
}
if (!(isset($image_url) && (strlen($image_url)>4))) {
if (($options['aktiv-artikelbild']==1) && (isset($options['artikelbild-src']))) {
if (isset($options['artikelbild-src_id']) && ($options['artikelbild-src_id']>0)) {
$image_url_data = wp_get_attachment_image_src( $options['artikelbild-src_id'], 'full');
$image_url = $image_url_data[0];
$attribs = piratenkleider_get_image_attributs($options['artikelbild-src_id']);
} else {
$image_url = $options['artikelbild-src'];
}
}
}
if (isset($image_url) && (strlen($image_url)>4)) {
if ($options['artikelbild-size']==1) {
echo '<div class="content-header-big">';
} else {
echo '<div class="content-header">';
}
?>
<header>
<h1 class="post-title"><span itemprop="headline"><?php the_title(); ?></span></h1>
</header>
<div class="symbolbild"><img src="<?php echo piratenkleider_make_link_relative($image_url); ?>" alt="" itemprop="image">
<?php if (isset($attribs["credits"]) && (strlen($attribs["credits"])>1)) {
echo '<div class="caption">'.$attribs["credits"].'</div>';
} ?>
</div>
</div>
<?php } ?>
<div class="skin">
<?php if (!(isset($image_url) && (strlen($image_url)>4))) { ?>
<h1 class="post-title"><span itemprop="headline"><?php the_title(); ?></span></h1>
<?php } ?>
<section <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php
$show_disclaimer = get_post_meta( get_the_ID(), 'piratenkleider-show-post-disclaimer', true );
if ( (isset($show_disclaimer)) && (isset($options['post_disclaimer'])) && ($options['post_disclaimer']<>'')
&& ( ($show_disclaimer==1) || ($show_disclaimer==3))
) {
echo '<div class="disclaimer">'.$options['post_disclaimer'].'</div>';
}
echo piratenkleider_post_datumsbox();
?>
<article class="post-entry" itemprop="articleBody">
<?php
$subtitle = get_post_meta( get_the_ID(), 'piratenkleider_subtitle', true );
if ($subtitle) {
echo '<h2 class="subtitle">'.$subtitle."</h2>\n";
}
the_content();
?>
</article>
<?php
if ( (isset($show_disclaimer)) && (isset($options['post_disclaimer']))
&& ($options['post_disclaimer']<>'')
&& ( ($show_disclaimer==2) || ($show_disclaimer==3))
) {
echo '<div class="disclaimer">';
echo $options['post_disclaimer'];
echo '</div>';
}
?>
<div class="post-meta"><p>
<?php
piratenkleider_post_pubdateinfo();
if ($options['aktiv-autoren']) piratenkleider_post_autorinfo();
echo ' ';
piratenkleider_post_taxonominfo();
?>
</p>
</div>
<div><?php edit_post_link( __( 'Edit', 'piratenkleider' ), '', '' ); ?></div>
</section>
<div class="post-nav">
<ul>
<?php
previous_post_link('<li class="back">◀ %link</li>', '%title');
next_post_link('<li class="forward">%link ▶</li>', '%title');
?>
</ul>
</div>
<hr>
<div class="post-comments" id="comments">
<?php comments_template( '', true ); ?>
</div>
<?php if (has_filter( 'related_posts_by_category')) { ?>
<div class="post-nav">
<h3><?php _e("More entries:", 'piratenkleider'); ?></h3>
<ul class="related">
<?php do_action(
'related_posts_by_category',
array(
'orderby' => 'post_date',
'order' => 'DESC',
'limit' => 5,
'echo' => true,
'before' => '<li>',
'inside' => '',
'outside' => '',
'after' => '</li>',
'type' => 'post',
'message' => __('No more entries in this category found.','piratenkleider')
)
) ?>
</ul>
</div>
<?php } ?>
</div>
<?php endwhile; // end of the loop. ?>
</div>
<?php
$nosidebar = get_post_meta( get_the_ID(), 'piratenkleider_nosidebar', true );
if( !empty( $nosidebar ) && $nosidebar==1) {
echo "<!-- no sidebar -->\n";
} else {
?>
<div class="content-aside">
<div class="skin">
<h1 class="skip"><?php _e( 'More information', 'piratenkleider' ); ?></h1>
<?php
echo get_piratenkleider_steckbrief();
get_sidebar();
?>
</div>
</div>
<?php } ?>
</div>
<?php get_piratenkleider_socialmediaicons(2); ?>
</div>
<?php get_footer(); ?>