This repository has been archived by the owner on Nov 19, 2023. It is now read-only.
forked from korbinian/Piratenkleider
-
Notifications
You must be signed in to change notification settings - Fork 24
/
sidebar-teaser.php
145 lines (132 loc) · 7.2 KB
/
sidebar-teaser.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
<?php
global $defaultoptions;
global $options;
?>
<div class="first-teaser-widget-area">
<?php
$defaultbildsrc = $options['slider-defaultbildsrc'];
$cat = $options['slider-catid'];
global $thisCat;
if (isset($thisCat)) {
$cat = $thisCat;
}
if (!isset($cat) ) $cat = 1;
$numberarticle = $options['slider-numberarticle'];
if (!isset($numberarticle) ) $numberarticle =3;
global $thisCatName;
$subtitle = $options['teaser-subtitle'];
if (isset($thisCatName)) {
$subtitle = $thisCatName;
}
query_posts( array( 'cat' => "$cat", 'posts_per_page' => $numberarticle) );
?>
<div class="flexslider">
<h2 class="skip"><?php _e( 'Information slides', 'piratenkleider' ); ?></h2>
<ul class="slides">
<?php
if ( have_posts() ) while ( have_posts() ) : the_post();
echo '<li class="slide">';
if ($options['teaser-type'] == 'big') {
$attribs = array(
"credits" => $options['img-meta-credits'],
);
echo '<div class="bigslider">';
$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);
if (isset($image_url) && strlen($image_url)>0){
echo '<img src="'.$image_url.'" width="'.$options['highslider-width'].'" height="'.$options['highslider-height'].'" alt="">';
}
} elseif (has_post_thumbnail()) {
$thumbid = get_post_thumbnail_id(get_the_ID());
$image_url_data = wp_get_attachment_image_src( $thumbid, 'highslider');
if (! $image_url_data) {
$image_url_data = wp_get_attachment_image_src( $thumbid, 'bigslider');
}
if (! $image_url_data) {
$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)>0){
echo '<img src="'.$image_url.'" alt="">';
} else {
if (isset($options['slider-defaultbildsrc_id'])) {
$image_url_data = wp_get_attachment_image_src( $options['slider-defaultbildsrc_id'], 'full');
$image_url = $image_url_data[0];
$attribs = piratenkleider_get_image_attributs($options['slider-defaultbildsrc_id']);
} else {
$image_url = $options['slider-defaultbildsrc'];
$attribs = array("credits" => $options['img-meta-credits'] );
}
echo '<img src="'.$image_url.'" width="'.$options['bigslider-thumb-width'].'" height="'.$options['bigslider-thumb-height'].'" alt="">';
}
} else {
if (isset($options['slider-defaultbildsrc_id'])) {
$image_url_data = wp_get_attachment_image_src( $options['slider-defaultbildsrc_id'], 'full');
$image_url = $image_url_data[0];
$attribs = piratenkleider_get_image_attributs($options['slider-defaultbildsrc_id']);
}
if (!isset($image_url)) {
$image_url = $options['slider-defaultbildsrc'];
$attribs = array("credits" => $options['img-meta-credits'] );
}
echo '<img src="'.$image_url.'" width="'.$options['bigslider-thumb-width'].'" height="'.$options['bigslider-thumb-height'].'" alt="">';
}
echo '<div class="caption"><p class="cifont">'.$subtitle.'</p>';
echo '<h3><a href="';
the_permalink();
echo '">';
echo short_title('…', $options['teaser-title-words'], $options['teaser-title-maxlength']);
echo "</a></h3></div>";
if (($options['teaser-showcredits']==1) && isset($attribs["credits"]) && (strlen($attribs["credits"])>1)) {
echo '<div class="credits">'.$attribs["credits"].'</div>';
}
echo "</div>";
} else {
echo '<div class="textslider">';
if (has_post_thumbnail()) {
the_post_thumbnail(array($defaultoptions['smallslider-thumb-width'],$defaultoptions['smallslider-thumb-height']),array('alt'=> ''));
} else {
if (isset($options['slider-defaultbildsrc_id']) && ($options['slider-defaultbildsrc_id']>0)) {
$image_url_data = wp_get_attachment_image_src( $options['slider-defaultbildsrc_id'], 'full');
$image_url = $image_url_data[0];
$attribs = piratenkleider_get_image_attributs($options['slider-defaultbildsrc_id']);
} else {
$image_url = $options['slider-defaultbildsrc'];
$attribs = array("credits" => $options['img-meta-credits'] );
}
echo '<img src="'.$image_url.'" width="'.$options['smallslider-thumb-width'].'" height="'.$options['smallslider-thumb-height'].'" alt="">';
}
echo '<h3><a href="';
the_permalink();
echo '">';
the_title();
echo '</a></h3><div class="teaser-excerpt">';
echo get_piratenkleider_custom_excerpt();
echo "</div></div>";
}
echo "</li>\n";
endwhile;
echo "</ul>";
echo "</div>";
wp_reset_query();
?>
</div>
<div class="second-teaser-widget-area">
<div class="skin">
<?php if ( is_active_sidebar( 'second-teaser-widget-area' ) ) { ?>
<?php dynamic_sidebar( 'second-teaser-widget-area' ); ?>
<?php } else { ?>
<div class="teaserlinks">
<ul>
<li><a class="symbol symbol-<?php echo $options['teaserlink1-symbol'] ?>" href="<?php echo $options['teaserlink1-url'] ?>"><?php echo $options['teaserlink1-title'] ?> <span><?php echo $options['teaserlink1-untertitel'] ?></span></a></li>
<li><a class="symbol symbol-<?php echo $options['teaserlink2-symbol'] ?>" href="<?php echo $options['teaserlink2-url'] ?>"><?php echo $options['teaserlink2-title'] ?> <span><?php echo $options['teaserlink2-untertitel'] ?></span></a></li>
<li><a class="symbol symbol-<?php echo $options['teaserlink3-symbol'] ?>" href="<?php echo $options['teaserlink3-url'] ?>"><?php echo $options['teaserlink3-title'] ?> <span><?php echo $options['teaserlink3-untertitel'] ?></span></a></li>
</ul>
</div>
<?php } ?>
</div>
</div>