<?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内置图片仓库制作缩略图的小技巧》的一些看法。更多内容请查看本栏目更多内容!
esc_html()(本义 Html) esc_html() 函数用来本义 Html 代码,让 Html 代码不本义。 用法 esc_html( $tex...
区分访客国度有什么用? 这里是几个我利用该性能的例子. 1.区分网站性能 这个博客有翻译文章的性能, 这是...
利用弱小的技术,能够把基于WordPress的网站做成各种各样的方式,这除了要求WordPress主题开发人员通晓HTML...
WordPress 默许有 “订阅者”、“投稿者”、“作者”、“编辑” 和 “治理员” 五个用户角色,权限由低到高...
1、wp_nav_menu()函数引见:worpdress倒退到3.0当前添加了一个自定义菜单函数wp_nav_menu(),使得wordpress...
要害字形容:教程 治理 用户 权限 能够 编辑 注册 Wordpress 咱们 后面咱们讲述了 Wordpress 插件的应用。...