// function.php の getRecentKougabu を以下に差し替えます。 // ここから--> function getRecentKougabu($limit, $max_width, $max_width, $category = false) { global $wpdb; if($category == false) { $results = $wpdb->get_col($wpdb->prepare( "SELECT" . " ID" . " FROM" . " {$wpdb->posts}" . " WHERE" . " post_status = 'publish'" . " AND post_type = 'post'" . " AND post_password = ''" . " ORDER BY" . " post_date DESC LIMIT %d" , $limit )); } else { $results = $wpdb->get_col($wpdb->prepare( "SELECT" . " ID" . " FROM" . " {$wpdb->posts} as posts" . " , {$wpdb->term_taxonomy} as taxonomy" . " , {$wpdb->term_relationships} as relationships" . " WHERE" . " posts.ID = relationships.object_id" . " AND relationships.term_taxonomy_id = taxonomy.term_taxonomy_id" . " AND posts.post_status = 'publish'" . " AND posts.post_type = 'post'" . " AND posts.post_password = ''" . " AND taxonomy.taxonomy = 'category'" . " AND taxonomy.term_id = '%d'" . " ORDER BY" . " post_date DESC LIMIT %d" , $category , $limit )); } if(count($results) == 0) return array(); return kougabu_get_images(array( 'array' => true , 'post_id' => $results , 'max_width' => $max_width , 'max_height' => $max_width)); } // <--ここまで // 追加したテーマファイルの以下の部分を書き換えます。 $images) { ?> $images) { ?>