2013-03-07 51 views
0
<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> 

在WordPress我插入shartcode [gallery link="file" columns="3"],與W3C驗證的網站時,出現錯誤Element dl is missing a required instance of child element dd。這是一個WordPress的錯誤?如何解決這個錯誤?也許在gallery_shortcode()中添加標籤?WordPress的驗證錯誤元素DL缺少子元素所需的實例DD

回答

0

對此的答案是Wordpress使用dd作爲圖片標題,請參閱media.php中的代碼。 爲圖庫中的每個圖像添加一個標題,然後通過css中的「display none」刪除標題。

<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> 

CSS:

.my_class .wp-caption-text.gallery-caption{ 
display: none; 
} 

萬一別人是找這個。 一點點混亂,但它的作品。