Php Lightbox未正确显示内容Wordpress
我正在构建一个带有自定义帖子类型的wordpress公文包。该页面显示了图片的缩略图,当你翻过它们时,你会看到标题、摘录和一个链接,可以在一个灯箱中看到文章的内容。为了得到lightbox,我使用了一个名为lightbox Plus ColorBox的插件。由于某些原因,只有部分图像与lightbox一起正常工作,而在其他图像上,lightbox不显示任何内容,您无法将其关闭。我假设它不知怎么陷入了一个循环,但我真的不知道如何修复它 该网站的网址是 这是我的页面代码:Php Lightbox未正确显示内容Wordpress,php,wordpress,lightbox,Php,Wordpress,Lightbox,我正在构建一个带有自定义帖子类型的wordpress公文包。该页面显示了图片的缩略图,当你翻过它们时,你会看到标题、摘录和一个链接,可以在一个灯箱中看到文章的内容。为了得到lightbox,我使用了一个名为lightbox Plus ColorBox的插件。由于某些原因,只有部分图像与lightbox一起正常工作,而在其他图像上,lightbox不显示任何内容,您无法将其关闭。我假设它不知怎么陷入了一个循环,但我真的不知道如何修复它 该网站的网址是 这是我的页面代码: <?php get_
<?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 ?>
您有几个问题,其中一个问题是内联元素中有块元素-
,谢谢您的回复。我忘记了那段代码,它实际上与缩放库无关,所以我删除了它。但这似乎并没有解决问题。奇怪的是,它对某些缩略图有效,但对其他缩略图无效。是的,但它并不总是得到正确的图像(至少不是用于缩放)。我认为问题可能与$this
没有针对正确的元素有关。我同意它似乎在努力针对正确的元素,但我真的不知道如何强制它针对正确的帖子。
$( "#zoomIn" ).click(function() {
$( "#zoomingOverlay" ).show( "slow" );
});
$( "#close" ).click(function() {
$( "#zoomingOverlay" ).hide( "slow" );
});
jQuery(document).ready(function($) {
// Inside of this function, $() will work as an alias for jQuery()
// and other libraries also using $ will not be accessible under this shortcut
});