How-to change the tabs order for ClassiPress Ad sidebar

This is a simple How-To where we will explain how to change the order of tabs for the Ad-Sidebar avoiding the problem with the refresh of the google maps widget:

1- Modify the file wp-content/themes/classipress/sidebar-ad.php: In this example, we move the map tab to the third position in the tab panel:

<a href="#priceblock2"><span class="big">
       < ?php _e('Contact', 'appthemes') ?></span></a>
       <ul class="tabnavig">
	<li><a href="#priceblock3"><span class="big"> < ?php _e('Poster', 'appthemes') ?></span></a></li>
          < ?php if ( $gmap_active ) { ?>
	<li><a href="#priceblock1"><span class="big">< ?php _e('Map', 'appthemes') ?></span> < ?php } ?> </a></li>
</ul>

Now, we have the google maps widget problem, because if this tab is not the first, the map don’t load completely because the div is hidden. To solve that, we need to make two more simple mods:

2- Inlude at the end of the file wp-content/themes/classipress/sidebar-ad.php this code:

<script>
jQuery(document).ready(function() {
	jQuery ('a[href=#priceblock1]').click(function(){
	jQuery ('#map').hide();
	load ();
	jQuery ('#map').fadeIn(500);
	codeAddress ();
	google.maps.event.trigger(map, 'resize');
	});
});	
</script>

3- Modify the file themes/classipress/includes/sidebar-gmap.php: Basically, we comment the initialization code for the map widget, because we did before with the previous mod. Then, we need to make the map variable global by removing the ‘var’ key word:

//< ![CDATA[
//  jQuery(document).ready(function($) {
//        $('#map').hide();
//        load();
//        $('#map').fadeIn(1000)
//        codeAddress();
//    });

map = null;