<?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内置图片仓库制作缩略图的小技巧》的一些看法。更多内容请查看本栏目更多内容!
comments_template comments_template 函数是一个调用评论模板的函数,应用起来很简略,与get_header()等函...
最近在做一个客户的企业网站建立时,需求往数据库提交信息的表单页面,然而Wordpress自带的评论性能来做的话...
要害字形容:装置 进程 如何 Wordpress   // 目录 define 文件 WordPress装置前的预备工作,如今咱们来...
复制代码代码如下: <?php the_time('Y-m-d'); ?> 显示的是 2011-10-1 这样的,修正()中内容用以下字符交换...
WordPress 的自定义字段就是文章的 meta 信息(元信息),利用这个性能,能够扩大文章的性能,是学习 WordP...
1、主动向 WordPress 编辑器拔出文本 编辑以后主标题录的 functions.php 文件,并粘贴以下代码: 复制代码代...