<?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统计以后页面数据库查问次数及耗费工夫的办法。分享给大家供大家参考。详细剖析如下...
环境 效劳器操作零碎:CentOS 7.0 博客部署效劳器:Apache 后盾言语:PHP 数据库:MySql 前端框...
在激活菜单性能,编辑菜单并且调用后。 上面次要内容为菜单鼠标悬停成果的完成以及子菜单排版成绩。 1.菜单...
在 PHP 中发送 Http 申请(GET / POST)有很多的办法,比方 file_get_contents() 函数、fopen() 函数或许 c...
置信很多站长都晓得并且曾经在应用WordPress自定义字段,很多插件也应用了这一性能。 自定义字段是一个十分...
本文实例讲述了wordpress利用键盘左右键完成上下翻页的办法。分享给大家供大家参考。详细剖析如下: 利用键...