我在使用WordPress网站上的滑块时遇到问题。当网站加载有时WordPress循环中断并且滑块的结尾div最终低于页面上的一些其他元素,使这些元素成为滑块的一部分。我尝试过禁用JavaScript,但问题仍然存在。
<div class="slidermap" id="map"></div>
<?php
$counter = 0;
?>
<?php if ($posts->have_posts()) : while ($posts->have_posts()) : $posts->the_post(); ?>
<?php
include 'variables.php';
$arr_sliderimages = get_gallery_images();
$resized_infowindowimage = aq_resize($arr_sliderimages[0], 50, 50, true);
?>
<?php
if ($map) {
$themap = $map;
} else {
$themap = $address . " " . $citystatezip;
}
$array_mapinfo[$counter] = array(0 =>$themap, 1=>$address, 2=>$citystatezip, 3=>$resized_infowindowimage, 4=>$price, 5=>get_permalink(), 6=>get_the_title());
$counter++;
?>
<?php endwhile ?>
<?php else : ?>
<?php endif; ?>
<?php include TEMPLATEPATH .'/js/resultsmap.php'; ?>
<div class="images">
<?php
$count = 1;
if ($posts->have_posts()) : while ($posts->have_posts()) : $posts->the_post(); ?>
<?php include 'variables.php';
$content = get_the_content();
?>
<?php if($count != 1) {
$hide = "style='display: none;'";
} ?>
<div class="slide"><!-- slide -->
<?php if ($slider == "Recent Listings") { ?>
<div class="slidertext" <?php echo $hide; ?>>
<div class="slidertext_inner">
<h2 class="citystatezip"><?php echo $locname ?></h2>
<p class="excerpt_text">
<?php echo substr($content, 0, 150) . "..." ?>
</p>
<?php /*
<ul>
<?php if ($cr == "Residential") { ?>
<li class="bedsbaths"><?php echo get_option('wp_bedrooms_text').": ".$beds. " • " . get_option('wp_bathrooms_text').": ". $baths ?></li>
<?php } ?>
<li class="price"><?php include 'price.php'; ?></li>
</ul> */ ?>
<div class="button_border"><a class="button" href="<?php the_permalink() ?>"><?php echo get_option('wp_read_more_text') ?></a></div>
</div><!-- end inner -->
</div><!-- end slidertext -->
<?php } ?>
<div class="sliderimage">
<?php $arr_sliderimages = get_gallery_images();
if ($slider == "Recent Listings") {
$w = 685;
} else {
$w = 720;
}
$resized = aq_resize($arr_sliderimages[0], $w, 320, true);
?>
<?php include 'bannerslarge.php'; ?>
<?php if($condoshopdate) {
$condoshopdate2 = strtotime($condoshopdate);
$today = strtotime(Date("F d, Y"));
if ($today <= $condoshopdate2) {
echo "<div class='condoshopbanner'><div class='condoshopdatetime'>".$condoshopdate.", ".$condoshoptime."</div></div>";
}
} ?>
<?php if ($slider == "Recent Listings") { ?>
<?php } else { ?>
<a href="<?php echo $slideshow_url; ?>"><img alt="" class="sliderborder" src="<?php bloginfo('template_url') ?>/images/sliderborder.png" /></a>
<?php } ?>
<?php if ($slider == "Recent Listings") { ?>
<div class="faderight"></div>
<?php } ?>
<img width="<?php echo $w ?>" height="320" alt="" src="<?php echo $resized ?>" />
</div><!-- end sliderimage -->
</div> <!-- end slide -->
<?php $count++ ?>
<?php endwhile; else: ?>
<p><strong>There are no items to display. You need to add at least one Property Listing post.</strong></p>
<?php endif;
wp_reset_query(); ?>
</div><!-- end images -->
答案 0 :(得分:0)
我发现问题是如何通过这行代码生成摘录。由于某种原因,主题创建者仅使用the_excerpt()。谢谢!