Change tabs in ad-widget (vers. 3.1.8)
The original widget inside an ad shows:
Map | Contact | Poster
The goal of this tutorial is to show it this way:
Contact | Poster | Map Tested for Classipress
Version 3.1.8. and a thanks to rubencio who made this changes for the previous versions. Please see the following screenshot:
[CENTER]
contactfirst.jpg[/CENTER]
To get this done, we need to change 2 files:
/
wp-content/themes/classipress/
sidebar-ad.php
/
wp-content/themes/classipress/includes/
sidebar-gmap.php
First, make a backup of thoose 2 files! Done? Ok, lets start:
1.)
Open the
sidebar-ad.php and find the following code (starts at line 19)
PHP Code:
<ul class="tabnavig">
<?php if ( $gmap_active ) { ?>
<li><a href="#priceblock1"><span class="big"><?php _e('Map', 'appthemes') ?></span></a></li>
<?php } ?>
<li><a href="#priceblock2"><span class="big"><?php _e('Contact', 'appthemes') ?></span></a></li>
<li><a href="#priceblock3"><span class="big"><?php _e('Poster', 'appthemes') ?></span></a></li>
</ul>
R
eplace the above code with the following code:
PHP Code:
<ul class="tabnavig">
<li><a href="#priceblock2"><span class="big"><?php _e('Contact', 'appthemes') ?></span></a></li>
<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></a></li>
<?php } ?>
</ul>
Now go down to the last line and add the following code
under the last line:
PHP 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>
Save the file.
__________________________________________________ __________________________________________________
2.)
Open the
sidebar-gmap.php (inside the /includes folder) and find the following code (line 21)
PHP Code:
<?php
// Google map on single page
function cp_google_maps_js() {
?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($) {
$('#map').hide();
load();
$('#map').fadeIn(1000)
codeAddress();
});
Replace the above code with the following:
PHP Code:
<?php
// Google map on single page
function cp_google_maps_js() {
?>
<script type="text/javascript">
//<![CDATA[
// jQuery(document).ready(function($) {
// $('#map').hide();
// load();
// $('#map').fadeIn(1000)
// codeAddress();
// });
map = null;
Save the file.
__________________________________________________ ________________________________________________
3.)
Enjoy and drink a beer
If you have a question or problem, please write here.
Greets