<?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内置图片仓库制作缩略图的小技巧》的一些看法。更多内容请查看本栏目更多内容!
在wordpress模板制造进程中,有一些貌似复杂的成绩,其实只需确定了成绩呈现的地位,大少数都能够自行处理。...
本文实例讲述了WordPress获取以后页面URL地址的办法。分享给大家供大家参考。详细如下: 咱们常常在做WordP...
本文实例讲述了WordPress首页显示多个图片及文字友谊链接的办法。分享给大家供大家参考。详细剖析如下: Wo...
本文实例讲述了wordpress给文章生成二维码的办法。分享给大家供大家参考。详细完成办法如下: 最简略的调用...
1、修正文章页面模板single.php关上模版文件中的single.php,在其中搜寻在这行上面加上:复制代码代码如下:...
本文实例讲述了WordPress完成回复文章评论后发送邮件告诉的性能。分享给大家供大家参考,详细如下: 很多时...