Results 1 to 3 of 3

Thread: No state = no map!

  1. #1
    Thread Starter
    lucrothe's Avatar
    Join Date
    Apr 2010
    Location
    United States
    Posts
    91
    Thanks
    18
    Thanked 13 Times in 7 Posts

    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?

  2. #2
    Amateur moabi's Avatar
    Join Date
    Dec 2010
    Location
    France
    Posts
    19
    Thanks
    1
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Amateur moabi's Avatar
    Join Date
    Dec 2010
    Location
    France
    Posts
    19
    Thanks
    1
    Thanked 1 Time in 1 Post

    remove Google map menu item (Tutorial)

    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. State and country bug when adding listing
    By harry_ej in forum Report ClassiPress Bugs
    Replies: 2
    Last Post: April 11th, 2010, 04:21 PM
  2. Region Select - Country/state
    By garyt in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: April 4th, 2010, 01:54 AM
  3. State don request
    By ricsca in forum Help Using ClassiPress
    Replies: 1
    Last Post: April 2nd, 2010, 09:59 PM