$the_query = new WP_Query($args);
foreach($the_query->posts as $key=>$value){
var_dump($value->ID, $value->post_date, $value->post_content);
$thumb_id = get_post_thumbnail_id($postID); // 指定した投稿のアイキャッチ画像の画像IDを取得
$thumb_img = wp_get_attachment_image_src($thumb_id );
$src = $thumb_img[0];
$postID = get_the_ID();
$fivesdrafts = $wpdb->get_results(
"SELECT name , slug
FROM $wpdb->term_relationships
LEFT JOIN $wpdb->term_taxonomy USING (term_taxonomy_id)
LEFT JOIN $wpdb->terms USING(term_id)
WHERE object_id = $postID
AND taxonomy = 'post_tag'"
);
foreach ($fivesdrafts as $key => $val) {
$tag .= $val->slug . $val->name ; // スラッグ。タグ
}
WP_Query から投稿記事やらアイキャッチやらタグを取得
Categories:
Tags: