WordPress:图库
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WordPress:图库相关的知识,希望对你有一定的参考价值。
For use within The Loop, in your portfolio item page template.
<?php // http://tylersticka.com/2009/09/wcpdx09/ // Retrieve custom meta for this item $fields = get_post_custom(); // If the gallery key exists, let's show some gallery functionality // Split the comma-separated gallery meta value into an array // Grab the current WordPress page and use it as the current // gallery item (defaults to 1) $current = ($paged == '') ? 1 : $paged; // Grab the current image from the array $image = $images[$current-1]; // Display the current gallery image with intelligent alt text ?> <div id="gallery"> <?php // Only show "next" and "back" controls if there's more // than one gallery item ?> <ul> <?php if ($current > 1) { ?><li class="prev"><a href="<?php the_permalink() ?>page/<?php echo $current-1; ?>">Previous Image</a></li><?php } ?> <?php if ($current < count($images)) { ?><li class="next"><a href="<?php the_permalink() ?>page/<?php echo $current+1; ?>">Next Image</a></li><?php } ?> </ul> <?php } ?> </div> <?php } ?>
以上是关于WordPress:图库的主要内容,如果未能解决你的问题,请参考以下文章
WordPress 全屏图库 wordpress 插件 - 如何获取下一个和上一个按钮