大概就下面这种情况:
创新互联主要从事成都网站制作、网站设计、网页设计、企业做网站、公司建网站等业务。立足成都服务个旧,十余年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:028-86922220
?php if (have_posts()) : $count=1; while (have_posts()) : the_post(); ?
h1?php the_title(); ?/h1 !-- 标题 --
div id="content"?php the_content(); ?/div !-- 文章内容 --
?php if($count==1): ?
img src="?php catch_that_image(); ?" width="200" height="200" alt="?php the_title(); ?"
?php $count++;else: ?
img src="?php catch_that_image(); ?" width="100" height="100" alt="?php the_title(); ?"
?php endif; ?
调用最新文章:
?php query_posts(‘showposts=14′); ?
ul
?php while (have_posts()) : the_post(); ?
lia title=”?php the_title(); ?” href=”?php the_permalink() ?”?php the_title(); ?/a/li
?php endwhile; ?
/ul
调用热门文章:
ul
?php
$post_num = 14; // 设置调用条数
$args = array(
‘post_password’ = ”,
‘post_status’ = ‘publish’, // 只选公开的文章.
‘post__not_in’ = array($post-ID),//排除当前文章
‘caller_get_posts’ = 1, // 排除置顶文章.
‘orderby’ = ‘comment_count’, // 依评论数排序.
‘posts_per_page’ = $post_num
);
$query_posts = new WP_Query();
$query_posts-query($args);
while( $query_posts-have_posts() ) { $query_posts-the_post(); ?
lia href=”?php the_permalink(); ?” title=”?php the_title(); ?”?php the_title(); ?/a/li
?php } wp_reset_query();?
/ul
调用随机文章:
ul
?php
global $post;
$postid = $post-ID;
$args = array( ‘orderby’ = ‘rand’, ‘post__not_in’ = array($post-ID), ‘showposts’ = 14);
$query_posts = new WP_Query();
$query_posts-query($args);
?
?php while ($query_posts-have_posts()) : $query_posts-the_post(); ?
lia href=”?php the_permalink(); ?” title=”?php the_title_attribute(); ?”?php the_title(); ?/a/li
?php endwhile; ?
/ul
如果是从今日头条同步采集导入到WordPress的话,有相关的插件,在后台插件页面搜索 今日头条即可