<?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内置图片仓库制作缩略图的小技巧》的一些看法。更多内容请查看本栏目更多内容!
这里有几个经过往wp-config.php中增加代码完成相干性能的技巧分享给大家。 1,去掉WordPress的历史修订版本...
一、发现成绩 在尝试编辑博客站点的Wordpress主题时,忽然发现博客站点无奈衔接;刷新后提醒“建设数据库衔...
最近我心血来潮给博客建一个分类别名为“WordPress”的目录。可是不断提醒“别名已被其它条...
本文实例讲述了WordPress获取以后页面URL地址的办法。分享给大家供大家参考。详细如下: 咱们常常在做WordP...
以下代码来自网络,未经测试,操作数据库有危险,请事前备份 !为一切文章和页面增加自定义字段 这段代码能...
最近发现 有不少文章配上图片,写得比拟长。这样会招致页面加载速渡过慢,不利于用户体验。尤其是新增加的 ...