WordPress get_posts()のテンプレート

 5,
    'offset'           => 0,
    'category'         => '',
    'orderby'          => 'post_date',
    'order'            => 'DESC',
    'include'          => '',
    'exclude'          => '',
    'meta_key'         => '',
    'meta_value'       => '',
    'post_type'        => 'post',
    'post_mime_type'   => '',
    'post_parent'      => '',
    'post_status'      => 'publish',
    'suppress_filters' => true
);

$myposts = get_posts($args);
foreach ($myposts as $post) : setup_postdata($post);

//ループ the_title()など

endforeach;
wp_reset_postdata();

この記事が気に入ったら、シェアしよう