<?php $args = array(
'posts_per_page' => 5,
'offset' => 0,
'category' => '',
'category_name' => '',
'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
);
$posts_array = get_posts( $args ); ?>
答案 0 :(得分:2)
好的,没关系,在文档中找到了我的解决方案。如果有人需要,
$args = array(
'post_type' => 'product',
'meta_query' => array(
array(
'key' => 'featured',
'value' => 'yes',
)
)
);
$postslist = get_posts( $args );