Warning: Illegal string offset 'output_key' in /home/taoworks/public_html/wp-includes/nav-menu.php on line 604

Warning: Illegal string offset 'output_key' in /home/taoworks/public_html/wp-includes/nav-menu.php on line 604

Warning: Illegal string offset 'output_key' in /home/taoworks/public_html/wp-includes/nav-menu.php on line 604

Warning: Illegal string offset 'output_key' in /home/taoworks/public_html/wp-includes/nav-menu.php on line 604

Warning: Illegal string offset 'output_key' in /home/taoworks/public_html/wp-includes/nav-menu.php on line 604

陶●工作室

站長指南-Web hosting及WordPress設定


Warning: Illegal string offset 'output_key' in /home/taoworks/public_html/wp-includes/nav-menu.php on line 604

Warning: Illegal string offset 'output_key' in /home/taoworks/public_html/wp-includes/nav-menu.php on line 604

Warning: Illegal string offset 'output_key' in /home/taoworks/public_html/wp-includes/nav-menu.php on line 604

Warning: Illegal string offset 'output_key' in /home/taoworks/public_html/wp-includes/nav-menu.php on line 604

Warning: Illegal string offset 'output_key' in /home/taoworks/public_html/wp-includes/nav-menu.php on line 604
Posted by 陶 On 13 / 11 / 2011

很多時WP Theme都設計了在主頁配上一幅圖像,
那是很好的設計,美觀又吸引讀者的眼球。

但不是每一個post也有圖像的,那時會自動出現了一張dump 圖(如下圖)。

解決方法是改一下程式:
以FabThemes的Selene Template為例,
在 1 外觀–> 2 主題編輯器–> 3 修改functions.php

4 把

function sele_post_image(){
if ( has_post_thumbnail() ) {
	 the_post_thumbnail( 'sele_post', array('class' => 'postimg') );
} else {
?>
<img class="postimg" src="<?php bloginfo('template_directory'); ?>/images/dummy.jpg" alt="" />
<?php
};
}

改為

function sele_post_image(){
if ( has_post_thumbnail() ) {
	 the_post_thumbnail( 'sele_post', array('class' => 'postimg') );
}
}

相關文章

You must be logged in to post a comment.