Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress:通过attr排除特色图像_Wordpress_Gallery - Fatal编程技术网

Wordpress:通过attr排除特色图像

Wordpress:通过attr排除特色图像,wordpress,gallery,Wordpress,Gallery,我知道前面提供的答案与这里的问题类似,但我被一些忽略了gallery短代码中的“排除”的gallery插件卡住了。他们的php中都有这一行: extract(shortcode_atts(array( 'orderby' => 'menu_order ASC, ID ASC', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' =>

我知道前面提供的答案与这里的问题类似,但我被一些忽略了gallery短代码中的“排除”的gallery插件卡住了。他们的php中都有这一行:

extract(shortcode_atts(array(
    'orderby' => 'menu_order ASC, ID ASC',
    'id' => $post->ID,
    'itemtag' => 'dl',
    'icontag' => 'dt',
    'captiontag' => 'dd',
    'columns' => 3,
    'size' => 'thumbnail',
), $attr));
我怀疑其中只包含了“排除”这样的内容(从其他SO答案中):


但是它不起作用。。。有人能帮忙吗?这个问题已经让我失眠了好几个晚上,还得了流感。。。非常感谢

您的问题对我来说有点模糊,我无法准确理解您想要什么-但无论如何,请尝试添加include和exlude的参数:

'include'    => '',
'exclude'    => ''
就你而言

extract(shortcode_atts(array(
    'orderby' => 'menu_order ASC, ID ASC',
    'id' => $post->ID,
    'itemtag' => 'dl',
    'icontag' => 'dt',
    'captiontag' => 'dd',
    'columns' => 3,
    'size' => 'thumbnail',
    'include'    => '', //  ID to include or ..
    'exclude'    => '' //  ID to exlude or ..
), $attr));
现在-正如我所说的,关于您试图实现的目标,问题有点模糊,例如,在短代码本身内部,您在何处以及如何设置exlude/inlude参数 类似于-[gallery include=“23,39,45”]/[gallery exlude=“X,Y,Z”]或通过接口插件

extract(shortcode_atts(array(
    'orderby' => 'menu_order ASC, ID ASC',
    'id' => $post->ID,
    'itemtag' => 'dl',
    'icontag' => 'dt',
    'captiontag' => 'dd',
    'columns' => 3,
    'size' => 'thumbnail',
    'include'    => '', //  ID to include or ..
    'exclude'    => '' //  ID to exlude or ..
), $attr));