0
我如何過濾WordPress中的帖子或第一張圖片,然後顯示添加到主題的CSS類。我看到我可以在我的functions.php中使用API中的add_filter()函數,但是我有問題需要獲取每個帖子的第一張圖片。WordPress的帖子第一張圖片
<a href="http://localhost/wordpress/wp-content/uploads/2012/10/test.jpg">
<img class="alignnone size-full wp-image-95" width="540" height="300" alt="dell-vs-apple" src="http://localhost/wordpress/wp-content/uploads/2012/10/dell-vs-apple1.jpg">
</a>
<div class = "my_class">
<a href="http://localhost/wordpress/wp-content/uploads/2012/10/dell-vs-apple1.jpg">
<img class="alignnone size-full wp-image-95" width="540" height="300" alt="dell-vs-apple" src="http://localhost/wordpress/wp-content/uploads/2012/10/dell-vs-apple1.jpg">
</a>