我目前的WordPress主题有一个内置的画廊。每个图库显示第一个/主要缩略图,并且一旦点击,即可在shadowbox中打开该特定图库的全部内容。我现在的理想目标是找到一种方法来改变这种情况,而不是直接显示shadowbox,而是直接指向具有特定画廊内容的单个页面。单个页面上的WordPress画廊
正如下面我目前的画廊代码:
<div id="maincontentwrap">
<div class="main-sep">
</div><!-- .main-sep -->
<div id="contentwrap">
<div id="content-gallery" role="main">
<?php
$wp_query = new WP_Query();
$wp_query->query(array('post_type' => 'galleries', 'posts_per_page' => of_get_option('le_gallery_items'), 'paged' => $paged, 'orderby' => 'menu_order', 'order' => 'ASC'));
$mod = 1;
while ($wp_query->have_posts()) : $wp_query->the_post();
$attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order'));
if(has_post_thumbnail()) {
$src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
$src = $src[0];
}
else{
foreach ($attachments as $id => $attachment) {
$src = wp_get_attachment_url($id);
}
}
if ($mod % 3 == 0) {
echo ' <div class="gallery-entry-img-last">';
}
else{
echo ' <div class="gallery-entry-img">';
}
?>
<div class="gallery-entry-img-l"><a rel="next" href="<?php echo $src; ?>"><span class="rollover" ></span><img class="blog-entry-img" src="<?php echo get_bloginfo('stylesheet_directory'); ?>/library/tools/timthumb.php?src=<?php echo $src; ?>&w=270&h=198" alt="<?php get_the_title(); ?>"/></a>
<span class="gallery-entry-img-tab"></span>
</div>
<span class="gallery-index-title"><?php the_title(); ?></span>
<div class="hidden-gallery">
<?php
$pic_count = 0;
foreach ($attachments as $id => $attachment) {
$pic_count++;
$others_src = wp_get_attachment_url($id);
?>
<a rel="next" href="<?php echo $others_src; ?>" title="<?php the_title(); ?>"></a>
<?php
}
?>
</div><!-- .hidden-gallery-->
</div>
<?php
$mod++;
endwhile;
?>
<div style="clear:both;"></div>
</div>
</div><!-- #contentwrap-->
</div><!-- #maincontentwrap-->
会有人有一个想法,我怎么能有这样的实现?一些专家的建议将被真正赞赏。
哪个WordPress主题?这有助于了解可能的解决方案。谢谢。 – donlaur
主题被称为“le美食家” –