我想同时显示多个库。
有点像这样
[画廊id=234352832]
图像将按最新上传的图像进行排序,首先显示。
这种事情可能吗?
如果可能的话,我想不用插件就可以了。
我想同时显示多个库。
有点像这样
[画廊id=234352832]
图像将按最新上传的图像进行排序,首先显示。
这种事情可能吗?
如果可能的话,我想不用插件就可以了。
内置的[gallery]
shortcode不支持开箱即用。然而,很容易推出自己的“multi-gallery”短代码,如下所示:
<?php
add_action( \'init\', \'wpse36779_add_shortcode\' );
/**
* Adds the shortcode
*
* @ uses add_shortcode
*/
function wpse36779_add_shortcode()
{
add_shortcode( \'multigallery\', \'wpse36779_shortcode_cb\' );
}
/**
* The shortcode callback function
*
* @ uses do_shortcode
*/
function wpse36779_shortcode_cb( $atts )
{
$atts = shortcode_atts(
array(
\'id\' => false
),
$atts
);
if( ! $atts[\'id\'] )
{
// no list of ids? Just send back a gallery
return do_shortcode( \'[gallery]\' );
}
else
{
$ids = array_map( \'trim\', explode( \',\', $atts[\'id\'] ) );
$out = \'\';
foreach( $ids as $id )
{
if( $id )
$out .= do_shortcode( sprintf( \'[gallery id="%s"]\', absint( $id ) ) );
}
}
return $out;
}
当然,尽管你尽了最大的努力不使用插件,但这里还是一团糟as a plugin. 您可以在主题的functions.php
如果你真的真的真的不想使用插件的话。我正在建立一个同时使用WordPress和BuddyPress的网站,我希望建立一个自定义部分,用户可以上传作品,人们可以对其进行评论/评分。我浏览了各种不同的选项,但似乎使用自定义的帖子类型,然后允许成员提交内容是最好的选择。这是更好的方法吗?还是你认为帖子类型是最好的选择。要了解其所需的功能类型,请执行以下操作:http://dribbble.com/其想法是将图像作为类似域的URL。com/designs/my-awesome-work-2201/当查看成员档案时,您将能够查看他们的最新作品等,因此