我已经安装了NextGEN Gallery插件,并在相册中保存了我的所有图像。有人能支持我使用Galleryview 插件?
有没有更简单的方法?
我已经安装了NextGEN Gallery插件,并在相册中保存了我的所有图像。有人能支持我使用Galleryview 插件?
有没有更简单的方法?
当Nextgen Gallery和Nextgen Galleryview都处于活动状态时,短代码[nggallery id=1 template="galleryview"]
应与配合使用1
成为你的画廊ID。
// How to fetch NextGEN Gallery by custom query
$sqlquery = "SELECT * FROM wp_ngg_pictures
WHERE gid=3 AND wp_ngg_pictures.gid=\'wp_ngg_pictures\'.galleryid ";
$pageposts = $wpdb->get_results( $sqlquery );
if ( $pageposts ) {
global $post;
foreach ( $pageposts as $post ) {
?><img src="<?php echo $post->path; ?>/<?php echo $post->filename; ?>" alt=""><?php
}
}
在以前安装的WordPress中,可以在attachment.php 使用下面最初提供的代码here. 然而,我发现这个代码不再有效,因为图像编号不准确。是否有新代码可用?<?php global $post; $ancestors = get_post_ancestors($post->ID); $photos = get_children(array( \'post_mime_type\' => \'image\', \'