Like title said. I need delete blank space when post_meta don't have value.
Code example:
<?php
global $wp_query;
$postid = $wp_query->post->ID;
$meta = get_post_meta($postid, 'direccion', true);
if($meta != $empty) { echo "".$meta.""; }
?>
Entire code:
<?php
global $wp_query;
$postid = $wp_query->post->ID;
$meta = get_post_meta($postid, 'direccion', true);
if(!empty($meta)) {
echo $meta;
}
?>
<?php global $wp_query;
$postid = $wp_query->post->ID;
$meta = get_post_meta($postid, 'provinciadestacada', true);
if(!empty($meta)) {
echo $meta;
}
elseif(in_category( '951' )) {
echo 'Todas las provincias';
} ?>
<?php global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'poblacion', true);
?>
<?php global $wp_query;
$postid = $wp_query->post->ID;
$meta = get_post_meta($postid, 'codigopostal', true);
if($meta != $empty) { echo "(".$meta.")"; }
?>
$empty
? And what does delete blank space mean? Apart from that it even doesn't have any value...