<?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 的后盾...
而后你犯晕了吧。次要缘由是某些主题没有增加WP-postviews这款插件的支持代码,凑巧笔者的Green Park 2这款...
在 PHP 中发送 Http 申请(GET / POST)有很多的办法,比方 file_get_contents() 函数、fopen() 函数或许 c...
在WordPress 中,__()函数和__e()函数被用来辨认php文件中被标示的、需求被翻译成其它言语或本地化的字符串...
要害字形容:特点 次要 WordPress 能够 链接 公布 文章 博客 进行 WordPress 的次要特点。WordPress 有很多...
wordpress默许状况下,裁剪的图片会间接裁剪图片的两头局部,例如你上传了一张美女图片,上传下来因为图片的...