我要做的是获得某些习俗的post_title
像这样
post 1 = "PHP"
post 2 = "ASP"
post 3 = "HTML"
post 4 = "CSS"
在数组中我想选择帖子编号1,3,4答案必须在循环中并获得此结果
PHP
HTML
CSS
答案 0 :(得分:1)
$args = array('post__in' => array(1,3,4));
$posts = get_posts($args);
foreach ($posts as $p) echo $p->post_title.'<br>';