function thumb_img($soContent){
$soImages = '~<img [^\>]*\ />~';
preg_match_all( $soImages, $soContent, $thePics );
$allPics = count($thePics[0]);
if( $allPics > 0 ){
echo "<span id='thumb'>";
echo $thePics[0][0];
echo '</span>';
}
else {
echo "<span id='thumb'>";
echo "<img src='";
echo bloginfo('template_url');
echo "/images/thumb.gif'></span>";
}
}
thumb_img($post->post_content);
#thumb{margin:5px 15px 5px 5px;width:145px;height:120px;border:3px solid #eee;float:left;overflow:hidden;}
#thumb img{max-height:186px;max-width:186px}
以上就是安达网络工作室关于《WordPress简单三步实现首页文章显示缩略图(无插件)》的一些看法。更多内容请查看本栏目更多内容!
本文实例讲述了WordPress文章题目链接增加正在加载中提醒的办法。分享给大家供大家参考。详细剖析如下: 咱...
如在 Nicky 的博客中, 我发现了下图中的搜寻栏. 在搜寻栏中增加这样的提醒信息, 能够疏导访客对网站进行搜...
首先,什么是以后博客?和独自站点不同的是,Multisite会产生多个博客,称之为blog,即子站点(包括主站点)...
效劳器钱用光了要关了或许是效劳器想要搬家,需求备份各种数据。 明天简略的备份了一下在效劳器下面wordpre...
more标签 这种办法应该是最灵敏的一种办法,操作也很简略,只要要你在编辑文章的时分拔出more标签 或许应用...
Fatal error: Call to undefined method wpdb_2::delete() in /home/*/public_html/wp-includes/o...