How to show all posts of specific custom post type with their custom fields values?

The meta information is in a different db table from my understanding. What you’ll need to do is loop through each post and grab it’s meta data using get_fields().

Below is a sample from the query to find all the fields for a particular post.

$rows = $wpdb->get_results($wpdb->prepare(
    "SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE %s OR option_name LIKE %s",
    $post_id . '_%' ,
    '_' . $post_id . '_%' 
), ARRAY_A);

if( !empty($rows) ) {

    foreach( $rows as $row ) {

        $meta[ $row['option_name'] ][] = $row['option_value'];



A SQL wiz might be able to merge the two which would be great, but until then, stick with get_fields.