<?php
$post_id = 1; // 文章ID
echo get_post( $post_id )->post_content; // 输出文章的内容
echo get_post( $post_id )->post_title; // 输出文章的标题
?>
下面是调用文章ID为1,2,3的文章:
<?php
$postsl = get_posts(\"numberposts=4&post_type=any&include=1,2,3\");
if($postsl) : foreach( $postsl as $post ) : setup_postdata( $post );
?>
<li><a href=\"<?php the_permalink(); ?>\" rel=\"external nofollow\" ><?php the_title();?></a></li>
<?php endforeach; endif; ?>
最后一个可以作为置顶多个文章
原文链接:https://www.baijiascw.com/25616.html,转载请注明出处。
评论0