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验证错误元素dl缺少子元素dd的必需实例_Wordpress_Gallery_Shortcode - Fatal编程技术网

Wordpress验证错误元素dl缺少子元素dd的必需实例

Wordpress验证错误元素dl缺少子元素dd的必需实例,wordpress,gallery,shortcode,Wordpress,Gallery,Shortcode,在wordpress中,我插入shartcode[gallery link=“file”columns=“3”],当使用W3C验证站点时,get error元素dl缺少子元素dd的必需实例。是wordpress的bug?如何解决这个错误?可能会在gallery\u shortcode()?中添加标签答案是Wordpress使用dd作为图像标题,请参见media.php中的代码。 向库中的每个图像添加标题,然后通过css中的“显示无”删除标题 <dl class='gallery-item'

在wordpress中,我插入shartcode
[gallery link=“file”columns=“3”]
,当使用W3C验证站点时,get error
元素dl缺少子元素dd的必需实例。是wordpress的bug?如何解决这个错误?可能会在
gallery\u shortcode()

中添加标签答案是Wordpress使用dd作为图像标题,请参见media.php中的代码。 向库中的每个图像添加标题,然后通过css中的“显示无”删除标题

<dl class='gallery-item'>
<dt class='gallery-icon'>
                <a href='http://xxx.lt/wp-content/uploads/2013/02/snow-004.jpg' title='snow 004'><img width="200" height="81" src="http://xxx.lt/wp-content/uploads/2013/02/snow-004-200x81.jpg" class="attachment-thumbnail" alt="snow 004" /></a>
            </dt>
</dl>
以防万一有人在找这个。
有点混乱,但它是有效的。

我知道这个问题很老,但我刚才遇到了同样的问题,在搜索谷歌时,这是第一个出现的页面

html验证器给了我关于gallery的错误,我可以通过向functions.php添加以下代码来修复它--

<div class="my_class">    
 <div class='gallery'>
  <dl class='gallery-item'>
   <dt class='gallery-icon landscape'> 
    <img width="190" height="190" src="XXXX" class="attachment-thumbnail" alt="X" />
   </dt>
   <dd class='wp-caption-text gallery-caption'>Some Caption</dd>
  </dl>
 </div>
</div>
.my_class .wp-caption-text.gallery-caption{
 display: none;
}
add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'style', 'script' ) );