I am currently working on a property website and when retrieving stats from an array i do not want to show one in particular called ‘post_title’. Here is the code
<?php if ( have_properties() ) { ?>
<ul class="<?php wpp_css('property_featured_shortcode::featured_properties', "wpp_featured_properties_shortcode clearfix"); ?>">
<?php foreach ( returned_properties('load_gallery=false') as $property) { ?>
<li class="<?php wpp_css('property_featured_shortcode::property', "{$class} wpp_featured_property_container wp-caption clearfix"); ?>" >
<a class="<?php wpp_css('property_featured_shortcode::thumbnail', "featured_property_thumbnail"); ?>" href="<?php echo $property['permalink']; ?>">
<?php property_overview_image($thumbnail_size); ?>
</a>
<?php if(is_array($stats)): ?>
<ul class="<?php wpp_css('property_featured_shortcode::stats', "wp-caption-text shortcode_featured_properties"); ?>">
<?php foreach($stats as $stat):
if(empty($property[$stat])) continue;
?>
<li class="<?php echo $stat; ?>">
<dl>
<dt><?php echo (empty($wp_properties['property_stats'][$stat]) ? ucwords($stat) : $wp_properties['property_stats'][$stat]); ?>:</dt>
<dd><?php echo $property[$stat]; ?></dd>
</dl>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</li>
<?php } ?>
</ul>
<?php } ?>
and this is the result
.
How can i go about hiding the post title please?.
I have tried changing it to echo just title by trying the code below but it did not work.
<?php if ([$stat] == 'post_title') echo 'Title' ?>
Any help is appreciated.
Thanks.
The part you need to change is the label, which is being output by this code (you can tell from the colon being output at the end):
Try this: