0
我正在用自定義帖子類型構建wordpress投資組合。該頁面顯示圖像的縮略圖,當您翻閱它們時,您會看到標題,摘錄和鏈接,以查看燈箱中的帖子內容。要獲取燈箱,我使用了一個名爲Lightbox Plus ColorBox的插件。出於某種原因,只有一些圖像可以正常使用燈箱,而其他燈箱則不顯示任何內容,您無法關閉它。我認爲它陷入了一個循環不知何故,但我真的不知道如何解決它。Lightbox正確顯示內容Wordpress
該網站網址爲http://www.ginahughes.co.uk/commercial-photography/
這是我的網頁代碼:
<?php get_header(); ?>
<?php
//list terms in a given taxonomy (useful as a widget for twentyten)
$taxonomy = 'commercial-project-name';
$tax_terms = get_terms($taxonomy);
?>
<div class="project-titles wrap">
<ul>
<?php
foreach ($tax_terms as $tax_term) {
echo '<li>' . '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf(__("View all posts in %s"), $tax_term->name) . '" ' . '>' . $tax_term->name.'</a></li>';
}
?>
</ul>
</div>
<div id="content">
<div id="inner-content" class="wrap clearfix">
<div id="main" class="clearfix" role="main">
<div id="portfolio">
<div class="group">
<?php wp_reset_query(); ?>
<?php
query_posts('post_type=commercial-photo&posts_per_page=100');
$i=1;
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-<?=$i?> 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-<?=$i?>" style="padding:10px; ">
<?php the_content(); ?>
</div>
</div>
<?php $i++;endwhile; endif; wp_reset_query(); ?>
</div>
</div>
</div> <?php // end #main ?>
</div> <?php // end #inner-content ?>
</div> <?php // end #content ?>
謝謝你的回覆。我已經忘記了這段代碼,它實際上與縮放庫沒有關係,所以我刪除了它。這似乎並沒有解決問題,但。奇怪的是,它適用於某些縮略圖,但不適用於其他縮略圖。 。 。 – digitalitea
是的,但它並不總是得到正確的圖像(至少不是縮放)。我認爲這個問題可能與'$ this'有關,而不是針對正確的元素。 – mantis
我同意它似乎正在努力瞄準正確的元素,但我真的不知道如何強制它的目標正確的職位。 – digitalitea