【发布时间】:2014-02-11 09:09:07
【问题描述】:
我正在构建一个带有自定义帖子类型的 wordpress 作品集。该页面显示图像的缩略图,当您滚动它们时,您会看到标题、摘录和一个链接,以便在灯箱中查看帖子的内容。为了获得灯箱,我使用了一个名为 Lightbox Plus ColorBox 的插件。由于某种原因,灯箱会在每个帖子灯箱中显示最新帖子的内容,而不是显示与点击的缩略图相关的内容。
网站网址是http://www.ginahughes.co.uk
这是我的页面代码:
<div id="portfolio">
<div class="group">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$title= str_ireplace('"', '', trim(get_the_title()));
$desc= str_ireplace('"', '', trim(get_the_content()));
?>
<div class="bp-wrapper">
<a title="<?=$title?>: <?=$desc?>" href="<?php the_permalink() ?>"><?php the_post_thumbnail('portfolio-thumb'); ?></a>
<div class="bp-post-details">
<a title="<?=$title?>: <?=$desc?>" rel="lightbox" href="<?php the_permalink() ?>">
<h4>
<a class="lbp-inline-link-1 cboxElement" href="#">
<?=$title?></a></strong></h4>
<p><?php print get_the_excerpt(); ?></p>
</a>
</div>
</div>
<div style="display: none;">
<div id="lbp-inline-href-1" style="padding:10px; ">
<?php the_content(); ?>
</div>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
</div>
</div>
【问题讨论】:
标签: javascript jquery wordpress lightbox