我通过以下代码在页面中获得了帖子缩略图和帖子内容
<?php
$post_types = array('a', 'b','p','d','f');//post type names
foreach( $post_types as $post_type) {
// The Query
$the_query = new WP_Query( array(
'post_type' => $post_type,
'orderby' => 'post_date',
'order' => 'DESC'
));
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
}
?>
<?php endwhile; ?>
<?php }?>
现在我想从相应的帖子中获取自定义字段值。