试试这个,我已经编辑了你想要的东西。
$args = array(
\'post_type\' => \'post\',
\'post_status\' => \'publish\',
\'posts_per_page\' => -1,
);
$dbResult = new WP_Query($args);
while ( $dbResult->have_posts() ) {
$dbResult->the_post();
global $post;
// You can pass specific post id to get post meta values
$fields = get_post_custom_keys($post->ID); // all keys for post as values of array
if ($fields) {
foreach ($fields as $key => $value) {
// $value will give you meta_key\'s
$meta_value = get_post_meta($post->ID,$value,true);
// Exclude WP System Meta Keys
if ($value[0] != \'_\') {
// Meta Value
echo $meta_value;
}
}
}
}