<?php
$args = array(
'numberposts' => 1,
'order'=> 'ASC',
'post_mime_type' => 'image',
'post_parent' => $post->ID,
'post_status' => null,
'post_type' => 'attachment'
);
$attachments = get_children($args);
$imageUrl = '';
if($attachments) {
$image = array_pop($attachments);
$imageSrc = wp_get_attachment_image_src($image->ID, 'thumbnail');
$imageUrl = $imageSrc[0];
} else {
$imageUrl = get_bloginfo('template_url') . '/img/default.gif';
}
?>
<a href="<?php the_permalink() ?>"><img class="left" src="<?php _fcksavedurl=""<?php" _fcksavedurl=""<?php" echo $imageUrl; ?>" alt="<?php the_title(); ?>" width="150" height="150" /></a>
<?php include('thumb.php'); the_content('Read More...'); ?>
以上就是安达网络工作室关于《使用WordPress内置图片仓库制作缩略图的小技巧》的一些看法。更多内容请查看本栏目更多内容!
假如您的博客有很多很多图片,空间又有流量限度,那么避免他人盗取本人的图片链接应该说是势在必行了,由于...
get_avatar()(获取头像) get_avatar() 函数用来获取置顶邮箱或许用户的头像代码,在评论列表中十分罕用。...
本文实例讲述了WordPress疾速增加友谊链接性能的办法。分享给大家供大家参考。详细办法剖析如下: WordPres...
函数引见 update_option()用于更新数据表中存在的选项值。该函数可取代add_option,但不迭add_option灵敏。...
最新版本的WordPress 2.8的公布,为WordPress网站开发者带来了更多的便当,让像WPYOU这样的基于WordPress的...
要害字形容:装置 本地 如何 Wordpress 下载 应用 环境 // 版本 Windows 上一次教程将 wordpress如何装置,...