Save default value for empty or missing post meta
If you want to and only need to do what @tf suggested, what is just to take care of displaying a 0 if no value is present, you can construct a function to do so like this: function wpse121165_return_carprice() { $ecpt_carprice = get_post_meta($post->ID, ‘ecpt_carprice’, true); if(! empty( $ecpt_carprice ) ){ return $ecpt_carprice; } else { … Read more