No state = no map!
Hello,
Sometimes people will post things and not feel comfortable about posting their address information. Here is a quick fix to hide the Google Map sidebar/tab if nothing is posted in the state field.
Make a back up of sidebar-ad.php
After:
Code:
<div class="content_right">
<div class="tabprice">
<ul class="tabnavig">
<?php if (!empty($gmap_check)) { ?>
Paste this:
Code:
<?php
$value = get_post_meta($post->ID, 'cp_state', true);
if ($value == !null)
{
echo '[*]<a href="#priceblock1"><span class="big">';
_e('Map', 'cp');
echo '</span></a>';
}
else
{
}
?>
Then remove this line:
I'm not 100% sure if this is the best way to hide the map tab, but it's working... Could someone with more experience with PHP please comment on my code?