[qa cat=multisite-network homelink=none]
GeoDirectory Discounts and Coupon Codes
Visitors frequently ask if there are any discounts or coupon codes available. We decided to create this page to inform our visitors and members about any ongoing promotions, discounts or valid coupon codes.
This is the only page to be referenced for official GeoDirectory discounts and coupon codes. If you find a coupon code in any another website and that coupon code is not referenced here, it might be expired or simply an inaccurate information.
List of valid coupon codes
15% discount on memberships only
CODE: 15PERCENTSUBS2020
Valid until December 31th, 2020
10% discount on all products or memberships
CODE: 10PERCENT2020
Valid until December 31, 2020
Recurring Promotions
Many themes and plugins Shops offer discounts regularly throughout the years, especially during the big yearly sales like Black Friday, Labour Day or End of Year sales just to name few of the most popular.
Since we started, we are offering every year a Black Friday through Cyber Monday sale with discounts of up to 40% (the percentage might change every year). At the moment that is the only recurring discount promotion that we honor every year and you may expect it this and next year too.
We may come up with other promotions throughout the year, but we decide for them on the spot and as such, they are not guaranteed.
Discounts for Non-Profit, NGOs and Charitable Organizations
We appreciate groups coming together to better our communities and the world in general. Unfortunately, our aggressive price point means we cannot provide any further discounts. To learn more about pricing, please see the GeoDirectory pricing page.
Autoptimize Settings
GD Booster can not be used with this plugin, we recommend using WP Super Cache to compliment Autoptimize
Autoptimize is a popular html optimization plugin for WordPress and is now compatible with GeoDirectory. For Autoptimize and GeoDirectoy to work together properly there are a few settings you must enable.
Under Settings>Autoptimize>:
The settings below are the ones that worked best during our testing and are highly recommended to follow but your theme may require different settings.
- Enable: Optimize HTML Code?
- Enable: Optimize JavaScript Code?
- Disable: Force JavaScript in?
- Disable: Also aggregate inline JS?
- Exclude scripts from Autoptimize:
s_sid,smowtion_size,sc_project,WAU_,wau_add,comment-form-quicktags,edToolbar,ch_client,seal.js,jquery.js,frontend.min.js,quicktags.min.js,tinymce.min.js - Enable: Add try-catch wrapping?
- Enable: Optimize CSS Code?
- Enable: Generate data: URIs for images?
- Enable: Remove Google Fonts?
- Enable: Also aggregate inline CSS?
- Disable: Inline and Defer CSS?
- Enable: Inline all CSS?
- Exclude CSS from Autoptimize: admin-bar.min.css, dashicons.min.css
WP Super Cache
GD Booster can not be used with this plugin, we recommend using Autoptimize to compliment WP Super Cache
WP Super Cache is a very popular caching plugin for WordPress and is now compatible with GeoDirectory. For WP Super Cache and GeoDirectoy to work together properly there are a few settings you must enable.
Under Settings>WP Super Cache>Advanced make sure to set the following settings:
- Enable: Don’t cache pages for known users.
- Enable: Don’t cache pages with GET parameters. (?x=y at the end of a url)
Useful plugins
Here you can find a list of plugins we think might be useful to you if you are looking to extend your GD site. There are plenty of other plugins about, but we know the ones listed here all work without any conflict with GD.
- Autoptimize
- Better Search Replace
- Code Snippets
- Easy Theme and Plugin Upgrades
- Report Content
- Widget Logic
- Yoast SEO Free
- WP Super Cache
- WPML
Autoptimize
- Autoptimize is a popular html optimization plugin for WordPress and is now compatible with GeoDirectory.
- For Autoptimize and GeoDirectory to work together properly there are a few settings you must enable.
- Please keep reading here for details of those settings.
- GD Booster can not be used with this plugin, we recommend using WP Super Cache to compliment Autoptimize.
Better Search Replace
- Better Search Replace will assist with changing URLs or slugs etc in your database.
- It is also very helpful when changing your site from HTTP to HTTPS.
- Read more here
Code Snippets
- The Code Snippets plugin is an easy, clean and simple way to add code snippets to your site. It removes the need to add custom snippets to your theme’s functions.php file.
- It also allows you to update the files of a (child) theme without losing any customizations, because they are stored in the database instead of in your theme files.
- After installtion visit our ‘Tips and Tricks‘ page for snippets.
- Screenshot of an example snippet:

- Make sure you activate the snippet when using the Code Snippets plugin.
- To copy and paste any code from snippets in the GeoDIrectory documentation, hover over the right hand corner of the snippet and select view source:

Easy Theme and Plugin Upgrades
- WordPress has a built-in feature to install themes and plugins by supplying a zip file. Unfortunately, you cannot upgrade a theme or plugin using the same process. Instead, WordPress will say “destination already exists” when trying to upgrade using a zip file and will fail to upgrade the theme or plugin.
- Easy Theme and Plugin Upgrades fixes this limitation in WordPress by automatically upgrading the GeoDirectory theme or plugin if it already exists.
Report Content
- This plugin allows you to add a simple Ajax powered form to your listings so that your visitors can report inappropriate content, broken links and bugs.
- To make it work with your GD listings:
- Install and activate the Report Content plugin the usual way.
- Once installed select Reports > Settings from your WordPress admin menu, and under Integration Settings, set Add the report form to Manual:

- To add the Report form to your GD Detail pages, add this code to your child theme’s functions.php file, or use the Code Snippets plugin:
[php]add_action(‘geodir_details_main_content’, ‘wprc_report_submission_form’,60);[/php]
- And this is how it should all look:

Widget Logic
- The Widget Logic plugin lets you control on which pages widgets appear using WP’s conditional tags.
- This example will show the dashboard widget only to users that are logged in:

- Some GD specific codes to use:
- Only shows the widget if the post type is Places:
[php]geodir_get_current_posttype()==’gd_place'[/php]
for a single GD Place detail page
[php]is_singular( ‘gd_place’ )[/php]
for a GD Place Archive Page
[php]is_post_type_archive(‘gd_place’)[/php]
- Will show the widget if the location is Queensland:
[php]strtolower(geodir_get_current_location(array(‘echo’ => false)))==strtolower(‘queensland’)[/php]
- Will show the widget if the page is a Custom Post Type page for Places, ie not for a category, AND if the location is Queensland:
[php]geodir_is_page(‘pt’) && get_query_var( ‘post_type’ )==’gd_place’ && strtolower(geodir_get_current_location(array(‘echo’ => false)))==strtolower(‘queensland’)[/php]
- Will show the widget if the location has the slug el-dorado-hills in the URL:
[php]in_array(‘el-dorado-hills’, geodir_get_current_location_terms(‘query_vars’))[/php]
- Only shows the widget if the post type is Places:
- You can find all the Conditional tags here.
- If the code does not work as expected, the first thing to check is that you are using straight quotes instead of curly quotes; this can happen when copying and pasting code.
Yoast SEO
-
- The Yoast SEO helps you write bettercontent with previews and page analaysis.
- Search the forums for hundreds of tips on how to use this plugin to improve your rankings.
- Yoast SEO is the best and only plugin that can be used for creating sitemaps (sitemap.xml) when the Location Manager Add On is active.
![]()
WP Super Cache
- WP Super Cache is a very popular caching plugin for WordPress and is now compatible with GeoDirectory.
- For WP Super Cache and GeoDirectory to work together properly there are a few settings you must enable.
- Under Settings > WP Super Cache > Advanced make sure to set the following settings:
- Enable: Don’t cache pages for known users.
- Enable: Don’t cache pages with GET parameters. (?x=y at the end of a url)
- GD Booster can not be used with this plugin, we recommend using Autoptimize to compliment WP Super Cache
WPML
WPML makes it easy to create a multilingual GeoDirectory site. All that is required is the Multilingual Blog plugin itself. Once installed check the following settings:
- WPML > Languages > Language URL format: select Different languages in directories (examples: yoursite.com/en, yoursite.com/fr etc)
- WPML > Translation Options > Custom Posts: select your Custom Post types, like Places and Events.
(This option will not show if you have the WPML Translation Management plugin active – in that case, go here) - If you want to translate Custom Post Type slugs as well, you need the Multilingual CMS plugin.
Review GD translation documentation
Default Featured Image
Have you ever wanted to create a slideshow with another plugin, but, found that the Listing Featured Images didn’t appear as expected? This plugin will ‘tick’ an additional option for the listing featured image so that the featured image, the first image for you listing, can be used in other ways and by other plugins on your site.
- Use a Default Featured Image with other third party plugins to create slideshows or other displays.
- GeoDirectory has you covered for GD specific lists, but you can use this plugin when you need a solution to work with other plugins.
- Get Default Featured Image on WordPress.org
Anti-Spam on Registration
We have two recommendations for keeping unwanted Spammers from registering on your site.
- Paid plugin – https://wordpress.org/plugins/cleantalk-spam-protect/
- Free plugin – Stop Spammer Registrations – https://wordpress.org/plugins/stop-spammer-registrations-plugin/
Email Log
Wondering why you aren’t receiving email from your site?
- Email Log https://wordpress.org/plugins/email-log/
- Log each email that is created by the site, and verify if it is sent out or not.
Moving videos to the sidebar of the detail page
Introduction
- One of the standard custom fields is a video field where you or your users can add a YouTube video to a listing.
- That video then will show on the detail page in the content section of the listing.
- This article explains how you can move the video from the content section to the sidebar.
Before:

After:

Step 1: Install Code Snippets plugin
- You can add the code below to your child theme’s functions.php file as well, but using the Code Snippets plugin makes it easier to keep track of the code, and it will be less likely the code is overwritten by a theme update.
Step 2: Code
Add a new code snippet, and copy and paste the following code:
[php]
add_filter(‘geodir_detail_page_tab_is_display’, ‘custom_gd_hide_video_tab’, 10, 2);
function custom_gd_hide_video_tab($value, $tab) {
if ($tab == ‘post_video’) {
$value = false;
}
return $value;
}
add_action(‘geodir_detail_sidebar_inside’, ‘custom_gd_show_video_in_sidebar’, 1);
function custom_gd_show_video_in_sidebar() {
global $post;
$video = ”;
if (geodir_is_page(‘preview’)) {
$video = isset($post->geodir_video) ? $post->geodir_video : ”;
} elseif (geodir_is_page(‘detail’)) {
$video = geodir_get_video($post->ID);
}
if ($video != ”) {
echo ‘<div class="geodir-video-wrapper">’;
echo wp_oembed_get(stripslashes($video));
echo ‘</div>’;
}
}
add_action(‘wp_head’, ‘custom_video_responsive_css’);
function custom_video_responsive_css() {
if (geodir_is_page(‘preview’) || geodir_is_page(‘detail’)) {
?>
<style type="text/css">
.geodir-video-wrapper {
margin-top: 20px;
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
margin-bottom: 10px;
}
.geodir-video-wrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
<?php
}
}
[/php]
Make sure you activate the snippet when using the Code Snippets plugin.
Step 3: Adding video link
When adding the video link, only add the link to the video. For example:
[html]https://www.youtube.com/watch?v=rxgWHzMvXOY[/html]
Step 4: Add a tip for your users
You can add a description to the video field at GD > Place Settings > Custom fields > Video field:

Changing the layout of addresses
The default display of addresses is in this format:
Address: Street Address
City
Region
ZIP or postcode
Country
That format is not always how addresses are set out in some countries, or you want to drop the region or country etc.
The following code, when added to functions.php of your child theme, or as a code snippet when you use the Code Snippets plugin, will output exactly the same as the default display above:
[php]
add_filter(‘geodir_show_post_address’, ‘geodir_change_address_order’ , 100 , 2) ;
function geodir_change_address_order($html , $vars)
{
global $post, $preview, $wpdb;
$field_icon=”;
if (strpos($field_icon,’http’) !== false) {$field_icon_af = ”;}
elseif($field_icon==”){$field_icon_af = ‘<i class="fa fa-home"></i>’;}
else{$field_icon_af = $field_icon; $field_icon=”;}
if(!$preview)
{
$html = ‘
‘;
$html .= ‘<span class="geodir-i-location" style="’.$field_icon.’">’.$field_icon_af;
$html .= ‘ Address: ’;
$html .= ‘</span>’;
//print_r($_POST);
if($post->post_address){ $html .= ‘<span itemprop="streetAddress">’.$post->post_address.'</span>
‘;}
if($post->post_city){ $html .= ‘<span itemprop="addressLocality">’.$post->post_city.'</span>
‘;}
if($post->post_region){ $html .= ‘<span itemprop="addressRegion">’.$post->post_region.'</span>
‘;}
if($post->post_zip){ $html .= ‘<span itemprop="postalCode">’.$post->post_zip.'</span>
‘;}
if($post->post_country){ $html .= ‘<span itemprop="addressCountry">’.$post->post_country.'</span>
‘;}
$html .= ‘
‘;
}
return $html ;
}
[/php]
Always back up your functions.php before making changes, in case you make a mistake!
By adjusting parts of the code, we can move things around, or delete parts. Let’s for example change the format to:
Address:
Street Address
City ZIP or postcode
Country
The following changes to the above code give an example of how the address format can be customized:
[php]
if($post->post_address){ $html .= ‘
<span itemprop="streetAddress">’.$post->post_address.'</span>
‘;}
if($post->post_city){ $html .= ‘<span itemprop="addressLocality">’.$post->post_city.'</span> ‘;}
if($post->post_zip){ $html .= ‘<span itemprop="postalCode">’.$post->post_zip.'</span>
‘;}
if($post->post_country){ $html .= ‘<span itemprop="addressCountry">’.$post->post_country.'</span>
‘;}
if($post->post_region){}
[/php]
Linking to Google Maps from a detail page
- You can get Google Map directions to the location of a listing from a standard GD detail page.
To get directions, you enter an address in the address field, and then click Get Directions:

- That will give directions on the Google map on the website page:

- The code snippet below will create a link on the detail page, that open Google Maps with the location of the GD listing ready on the map.
- On a mobile device you can then use the Google Map App to get directions.
[php]function geodirectory_detail_page_google_map_link( $options, $canvas ) {
global $post;if ( $canvas == ‘detail_page_map_canvas’ && !empty( $post->post_latitude ) && !empty( $post->post_longitude ) ) {
?>
<p><a href="http://maps.google.com/?q=<?php echo $post->post_latitude . ‘,’ . $post->post_longitude ;?>" target="_blank"><?php echo __( ‘Get Directions on Google Maps’, ‘geodirectory’ ); ?></a></p>
<?php
}
}
add_action( ‘geodir_map_after_render’, ‘geodirectory_detail_page_google_map_link’, 10, 2 );[/php]
Changing the position on the page
- The above code will add the link below the map on the detail page.
- If you want to add the link in the profile tab, you can use this code:
[php]function geodirectory_detail_page_google_map_link() {
global $post, $preview;if ( !$preview && !empty( $post->post_latitude ) && !empty( $post->post_longitude ) ) {
$maps_url = add_query_arg( array(
‘q’ => $post->post_latitude . ‘,’ . $post->post_longitude,
), ‘http://maps.google.com/’ );
?>
<p><a href="<?php echo $maps_url; ?>" target="_blank"><?php echo __( ‘Get Directions on Google Maps’, ‘geodirectory’ ); ?></a></p>
<?php
}
}
add_action( ‘geodir_after_description_on_listing_detail’, ‘geodirectory_detail_page_google_map_link’);[/php] - If you would like to move the link to the top, replace the string
geodir_after_description_on_listing_detail
with
geodir_before_description_on_listing_detail

GD Core Plugin – Titles & Metas
These are the sections you will find when you install the GeoDirectory Core (free) plugin only:
Overview – General – Google Analytics – Design – Permalinks – Titles & Metas – Notifications – Set Default Location – Place Settings – Theme Compatibility – Import & Export – GD Tools
On this page:
Introduction – Available variables – Using title & meta variables in widget titles
Introduction
- This image shows where to find the Titles & Metas settings:

- These settings allow you to change the meta title

and the meta description (Meta descriptions are commonly used on search engine result pages (SERPs) to display preview snippets for a webpage):

- If you use the Yoast SEO plugin, the settings added to GD > Titles & Metas will not work, you will need to use the settings of the Yoast SEO plugin.
Available variables
All meta titles and meta descriptions can use the following variables:
| %%title%% | Title of a listing. Do not use for listings pages. |
| %%sitename%% | Your site name as entered at WP Settings > General Settings > Site Title. |
| %%sitedesc%% | Your site description as entered at WP Settings > General Settings > Tagline. |
| %%excerpt%% | This refers to the WP excerpt you can add to listings, posts and pages. |
| %%pt_single%% | The singular form of a Custom Post Type, for example Place or Event. |
| %%pt_plural%% | The plural form of a Custom Post Type, for example Places or Events. |
| %%category%% | Indeed, the category. |
| %%id%% | The ID of the page or listing. |
| %%sep%% | Separator between parts. |
| %%location%% | Location in this format: city, region, country. |
| %%in_location%% | Location with a prefix of your choice in this format: in city, region, country. You can translate in in the core language file. |
| %%location_single%% | Location referring to the location of the page itself, for example Madrid, or Japan. |
| %%in_location_single%% | Location referring to the location of the page itself, with a prefix of your choice, for example in Los Angeles, or in Argentina. You can translate in in the core language file. |
| %%search_term%% | Whatever was entered as a search term (for search pages only). |
| %%search_near%% | Location entered in the Near field of the GD Search (for search pages only). |
| %%name%% | Name of the user (for author pages only). |
| %%page%% | Title of a WP page. |
| %%pagenumber%% | |
| %%pagetotal%% |
Using title & meta variables in widget titles
- To enable the use the above variables in the titles of GD widgets, add this code to your child theme’s functions.php file, or use the Code Snippets plugin:
[php]// Use title and meta variables in widget titles.
function gd_widget_title( $title ) {
if ( !empty( $title ) ) {
$title = geodir_filter_title_variables( $title, ‘location’, ” );
}return $title;
}
add_filter( ‘widget_title’, ‘gd_widget_title’, 10, 1 );
add_filter( ‘bestof_widget_title’, ‘gd_widget_title’, 10, 1 );
add_filter( ‘gd_features_widget_title’, ‘gd_widget_title’, 10, 1 );
add_filter( ‘geodir_cpt_categories_widget_title’, ‘gd_widget_title’, 10, 1 );
add_filter( ‘geodir_popular_location_widget_title’, ‘gd_widget_title’, 10, 1 );
add_filter( ‘geodir_location_description_widget_title’, ‘gd_widget_title’, 10, 1 );
add_filter( ‘geodir_location_neighbourhood_widget_title’, ‘gd_widget_title’, 10, 1 );[/php] - You can now add as a title to one of the above widgets, for example:

- And this would be the result for one of the location pages:

Updating your language files
Sometimes after an update of any of the GD plugins, you will find new words on your website and you cannot find how to translate them when looking in your language files.
This is because when a GD plugin is updated, the language file will have new language strings added.
This article explains how to merge the new language file with your PO and MO files already translated.
For this example, we will use a French GD core language file we need to update.
- Download the latest language file from the plugin:

- Navigate to your existing translate PO file:

- Open the geodirectory-fr_FR.po file with PoEdit:

- From the PoEdit menu, click Catalogue and then Update from POT file … :

- Browse to the PO file you downloaded at step 1, and Open:

- That will merge the new language strings with your translated file. Make any changes as required, save and upload.

