<?php
$args = array('post_type'=>'products','posts_per_page'=>10,'number_posts'=>10);
$products = get_posts($args);
foreach($products as $product) {
$productid = $product->ID;
echo $producttitle = $product->post_title;
echo $productdescription = $product->post_content;
echo get_post_meta($productid ,'price', TRUE);
echo get_post_meta($productid ,'product_name', TRUE);
echo get_post_meta($productid ,'size', TRUE);
}
?>
if the value is empty it shows null otherwise