Code

Support for Directories Pro - Directory plugin for WordPress

Support for Directories Pro - Directory plugin for WordPress

By
Cart 7,734 sales
Recently Updated

onokazu supports this item

Supported

This author's response time can be up to 2 business days.

Popular questions for this item

Help, I have a blank page!

Please enable the debug mode of WordPress and see if any error message appears.

To enable the debug mode, change the following line (you may not have any) in wp-config.php:

define('WP_DEBUG', false);

to

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
define('WP_DISABLE_FATAL_ERROR_HANDLER', true);

Make sure to add the lines to wp-config.php above where it says:

/* That's all, stop editing! Happy blogging. */

I am getting a 404 (Page Not Found) error!

Please first try running the “Reload components” tool from Directories -> System -> Tools and also try re-saving the settings under Directories -> Settings -> Pages and see if that resolves the issue. You may also need to visit Settings -> Permalinks in WordPress which automatically clears URL rewrite rules cached by WordPress.

If the issue persists, please contact support with the URL to the page where we can actually see the issue. https://codecanyon.net/item/directories-pro-for-wordpress/21800540/support/contact

What’s different from your another directory plugin, Sabai Directory?

The primary difference between Directories Pro and Sabai Directory is that Directories Pro fully utilizes custom post types and taxonomies, and Sabai Directory does not. This allows Directories Pro to become more compatible with other WordPress plugins like WordPress SEO by Yoast and WPML.

In addition, there are more features with Directories Pro than with Sabai Directory, for example, improved directory management, views, live updating facet counts, display editor, etc.

Directories Pro was initially developed as Sabai Directory 2.0, however we decided to release it as a separate plugin since internally (code-wise) it is a completely different product.

What shortcodes are available?

There are several shortcodes available with the plugin.

[drts-directory-search] – Shows a search form for your directory. For more details on the search feature, see https://directoriespro.com/documentation/getting-started/adding-search.html

[drts-view] – Used to display a view, which is simply a set of criteria and configurations to query, sort, and display content items in various ways. For more details on views, see https://directoriespro.com/documentation/getting-started/displaying-content-with-views.html

[drts-directory-payment-pricing] – Shows a pricing table that displays payment plans along with their features that you have setup for your directory. For more details on payment plans and monetization, see https://directoriespro.com/documentation/monetization.html

[drts-entity] – Used to show the full/partial content or certain field values of a listing.

Can a listing have multiple categories or locations?

Yes, that is possible by following these steps:

1. Go to Directories -> [Your Directory] -> Content Types -> Listing -> Manage Fields.
2. Hover over to the “Categories” or “Location” field and click the gear icon to configure the field.
3. Change the “Max number of values allowed” settings to more than 1 or “Unlimited”.
4. Press “Save Changes”.

Note that if your directory has payment features enabled, it is also affected by the “Max number of categories (or locations) allowed” setting of each payment plan or the default feature settings. For more details on this, please see this FAQ.

How can I create a landing page like that on your demo site?

The demo site uses the StoreFront theme and the landing page of the site is a WordPress page using the Homepage page template included with the theme.

The hero section of the landing page is where the content of the page is displayed by the Homepage template. We simply inserted the [drts-directory-search] shortcode as the page content to display a search form with some custom CSS rules for the transparent border around the form. Here is the exact shortcode syntax used:

[drts-directory-search directory="directory" size="lg" cache="1" style="padding:8px; background-color:rgba(0,0,0,0.15); border-radius:4px;"]

For more detail on the search form shortcode, please see Adding Search – Search form shortcode

Other sections of the landing page (photo slider, “Browse by Category”, “Popular Locations”, “Recent Listings”, “Recent Reviews” sections) are displayed using the Homepage Control plugin which is a free plugin that allows you to manage homepage components of Directories Pro. Your theme must be compatible with the Homepage Control plugin and unfortunately not many themes are compatible. For more details on Homepage Conrol and homepage components of Directories Pro, see Homepage Control.

If your theme is not compatible with Homepage Control, don’t worry. The homepage components of Directories Pro in Homepage Control are basically a wrapper to the [drts-directory-view] shortcode of Directories Pro. The [drts-directory-view] shortcode renders a view. A view is simply a set of criteria and configurations to query, sort, and display content items in various ways. You can create views and use the shortcode generated for each view to display the same content as homepage components of Homepage Control.

See Displaying Content with Views for more detail on views. In addition, take a look at the examples of custom views and step-by-step instructions on how to configure them.

How can I add a custom social media account field to listings?

Below is a code example for TripAdvisor. You can add the code to functions.php of your theme.

add_filter('drts_social_medias', function($medias) {
    $medias['tripadvisor'] = [
        'type' => 'textfield',
        'label' => 'TripAdvisor',
        'icon' => 'fab fa-tripadvisor', // icon can be found in https://fontawesome.com/icons?d=gallery&s=brands
        'image' => '', // enter URL of custom image here if there is no icon available
        'default' => 'tripadvisor',
        'placeholder' => 'Enter TripAdvisor username.',
    ];
    return $medias;
});
add_filter('drts_social_media_url', function($url, $name, $value) {
    if ($name === 'tripadvisor') {
        $url = 'https://www.tripadvisor.com/Profile/' . $value;
    }
    return $url;
}, 10, 3);

After adding the code, make sure to clear the cache from Directories -> System -> Tools. Then, enable TripAdvisor field by editing the Social Medias field from Directories -> [Your Directory] -> Content Types -> Listing -> Manage Fields.

Also, we recommend adding the code to functions.php of a child theme and not to that of the original theme. If you add the code to functions.php of the original theme, you will lose the modifications when you update the theme. For details on child themes, see https://codex.wordpress.org/Child_Themes

How can I change the default image that is displayed for listings without any photo?

You can add the following code to functions.php of your theme:

add_filter('drts_core_no_image_src', function($src, $size) {
    $src = 'http://url_to_your_custom_image_file';
    return $src;
}, 10, 2);

Make sure to replace http://url_to_your_custom_image_file in the code above with the URL of your custom image file. You can also use the value of the $size parameter (one of icon/thumbnail/medium/large/full) to change the image depending on the size requested.

In addition, in order to prevent the code from being deleted when you update your theme, we recommend creating a child theme of your current theme if you have not already done so and add the code to the child theme. For details on child themes, please see https://codex.wordpress.org/Child_Themes

If you also need to remove the small image icon overlay, you will need to add the following CSS to style.css of your theme:

.drts-display-element-with-background-no-image:before,
div.drts-no-image:before {
  display: none;
}

As of v1.3.61, an entity object is passed to the hook as the 3rd parameter. You can use this parameter to show an image depending on the post type or the category of the item for example.

add_filter('drts_core_no_image_cache', '__return_false'); // do not cache no image URL
add_filter('drts_core_no_image_src', function($src, $size, $entity) {
    if (isset($entity)
        && ($category = $entity->getSingleFieldValue('directory_category'))
        && is_object($category)
    ) {
        // Change image by category
        switch ($category->getSlug()) {
            case 'arts':
                $src = 'http://url_to_your_arts_category_image_file';
                break;
            case 'business':
                $src = 'http://url_to_your_business_category_image_file';
                break;
            default:
                $src = 'http://url_to_your_custom_image_file';
        }
    } else {
        // No entity or no valid category
        $src = 'http://url_to_your_custom_image_file';
    }
    return $src;
}, 10, 3);

How do I set a custom color for the search form submit button?

As of v1.3.56, you can change the color by configuring the “Primary color” setting under Directories -> Settings -> Appearance.

The [drts-directory-search] shortcode lets you choose from 8 color schemes (primary, secondary, success, warning, danger, info, dark, light) for the search form submit button which you can specify with the btn_color parameter. However if you wish to set a custom color other than those pre-defined, you will need to add the following CSS rules to your theme style.css. Make sure to change the background and border colors to your own color.

.drts-search-form .drts-search-form-submit,
.drts-search-form .drts-search-form-submit:hover,
.drts-search-form .drts-search-form-submit:not(:disabled):not(.drts-bs-disabled):active {
    background-color: #467fcf !important;
    border-color: #467fcf !important;
}

Is there a way to count and display the number of page views for each listing?

If you wish to show the number of page views for each listing in your directory, you can install either one of Koko Analytics, WP Statistics, Post Views Counter, or WordPress Popular Posts plugins. After installing one of the plugins, clear the cache using the “Clear cache” tool in Directories -> System -> Tools.

You can then display the number of page views for each listing using the “Statistics” display element that you can add from Directories -> [Your Directory] -> Listing -> Content Types -> Listing -> Manage Displays.

Is it possible to display listings with a payment plan first?

You can do so by editing the view that is displaying listings from Directories -> [Your Directory] -> Content Types -> Listing -> Manage Views. Edit the view, and you will see the “Show items with a payment plan first” setting under the “Sort Settings” tab. You can then also select and set the sort order of payment plans from the “Payment plan sort order” setting.

Note that if you have also switched on the “Show featured items first” option under the same tab, featured listings will be displayed above paid listings so the order will be Featured listings -> Paid listings -> No payment plan listings.

How do I use custom images as category icons and to also show them as map markers?

As of version 1.2.23, you can use custom images as category icons.

1. Make sure that you have already created a custom “Image” type field from Directories -> [Your Directory] -> Content Types -> Category -> Manage Fields.

2. Go to Directories -> [Your Directory] -> Content Types -> Category -> Edit, scroll down to “Image Settings” and select your custom image field created in step 1 from the dropdown shown for the “Default icon field” setting.

3. To show category icons as map markers, edit the view used to show listings on the map from Directories -> [Your Directory] -> Content Types -> Listing -> Manage Views, and select “Show taxonomy icon – Category” for the “Map marker icon” setting under the “General” tab.

Note: You can do the same with tags. Simply replace “Category” with “Tag” in the steps above.

Is Advanced Custom Fields supported?

Yes, as of version 1.2.15 you can display fields created with the Advance Custom Fields plugin in the backend form as well as in the add listing/review form in the frontend.

In order to display fields in the frontend form, go to Directories -> [Your Directory] -> Content Types -> Listing (or Review) -> Manage Fields, click the green add element button and then click “ACF Fields” under the “Content” tab in the popup. Then select a field group from the list of ACF field groups in the “Field group” setting and click “Save Changes”.

In order to display ACF field values in Directories Pro displays, you can use the “Text” display element in the “Manage Displays” section of your directory (Directories -> [Your Directory] -> Content Types -> Listing (or Review) -> Manage Displays). The “Text” display element supports shortcodes so for example you can enter:

[acf field="your_acf_field_name" post_id="%id%"]

The “ id ” part above will automatically be replaced by the ID of the currently viewed listing (or review). Make sure to change “your_acf_field_name” with the actual field name configured in ACF.

For more details on displays in Directories Pro, please see https://directoriespro.com/documentation/getting-started/managing-and-customizing-displays.html

How can I modify user links in Directories Pro to link to BuddyPress profile?

You can use the drts_core_user_link_attr filter hook to modify attributes of user links generated by Directories Pro. You can add the following code to functions.php of your theme.

add_filter('drts_core_user_link_attr', function($attr, $identity) {
    if ($identity->id
        && function_exists('bp_core_get_user_domain')
        && ($url = bp_core_get_user_domain($identity->id))
    ) {
        unset($attr['target']);
        $attr['href'] = $url;
    }
    return $attr;
}, 10, 2);

Also we recommend adding the code to functions.php of a child theme and not to that of the original theme. If you add the code to functions.php of the original theme, you will lose the modifications when you update the theme. For details on child themes, see https://codex.wordpress.org/Child_Themes

I am getting an error “Failed fetching timezone for XX.XXXX,YY.YYYY” when trying to set a location for a listing.

The cause of the error depends on the Time zone API you have selected for your site under Directories -> Settings -> Map -> General Settings.

- Google Maps Time Zone

Make sure that you have created a server API key for Google Maps API as instructed in the documentation (https://directoriespro.com/documentation/getting-started/installation.html#obtaining-a-google-maps-api-key) and have entered the API key to Directories -> Settings -> Map -> General Settings -> GOOGLE MAPS API SETTINGS (SERVER) -> API key.

If you have enabled the “Application restrictions” option when you created the server API key from Google API Console, make also sure that you have selected the “IP addresses” option and NOT the “HTTP referrers (web sites)” option which is for browser API keys only.

- GeoNames Web Service Timezone

Make sure first that you have created a user account at GeoNames website (http://www.geonames.org/login) and have enabled their free web services from their user account page (https://www.geonames.org/manageaccount). Then on your site, go to Directories -> Settings -> Map -> General Settings -> GEONAMES WEB SERVICE SETTINGS -> “GeoNames user name” in the backend and make sure your GeoNames user account name is entered correctly.

My directory does not need locations.

If you simply do not wish to use the Location taxonomy, you can simply leave the Locations section of your directory empty.

If you wish to not only disable the Location taxonomy but also the default Location field, you can do so by switching off the “Enable locations” option under Directories -> [Your Directory] -> Settings.

On the single listing page, I would like to display blog posts submitted by the listing author.

You will first need to install a 3rd party plugin that lets you display user posts using a shortcode. One of the plugins that we recommend is the “Display Posts” plugin (https://wordpress.org/plugins/display-posts-shortcode/).

After installing and activating the Display Posts plugin, please go to Directories -> [Your Directory] -> Content Types -> Listing -> Manage Displays -> Detailed and add a “Text” display element and then enter the following shortcode to the “Text content” section:

[display-posts author_id="%author_id%"]

This will display blog posts submitted on your site by the listing author. For the full list of parameters available with the shortcode, please see their documentation here: https://displayposts.com/docs/parameters/

How can I change the URL to which users are redirected after login/registration?

You can add the following code to functions.php of your theme. Make sure to change the URL_to_your_page part to your custom page URL.

add_filter('drts_frontendsubmit_after_login_register_url', function($url, $type, $identity) {
    $url = 'http://URL_to_your_page';
    return $url;
}, 10, 3);

If you wish to change the redirection URL for either user login or registration only, you can check the $type parameter, which will be either login or register.

For example, if you wish to the change the redirect URL for user registration only, you can change the above code to:

add_filter('drts_frontendsubmit_after_login_register_url', function($url, $type, $identity) {
    if ($type === 'register') {
        $url = 'http://URL_to_your_page';
    }
    return $url;
}, 10, 3);

Also we recommend adding the code to functions.php of a child theme and not to that of the original theme. If you add the code to functions.php of the original theme, you will lose the modifications when you update the theme. For details on child themes, see https://codex.wordpress.org/Child_Themes

How can I change the URL to which users are redirected after successful listing, review, or claim submission?

You can add the following code to functions.php of your theme. Make sure to change the URL_to_your_page part to your custom page URL.

add_filter('drts_frontendsubmit_add_entity_success_url', function ($url, $entity) {
    if ($entity->getBundleType() === 'directory__listing') {
        $url = 'http://URL_to_your_page_after_listing_submission';
    } elseif ($entity->getBundleType() === 'review_review') {
        $url = 'http://URL_to_your_page_after_review_submission'; 
    } elseif ($entity->getBundleType() === 'claiming_claim') {
        $url = 'http://URL_to_your_page_after_claim_submission'; 
    }
    return $url;
}, 10, 2);

Please note for redirection after listing submission, this works only when your directory does not have the payment feature enabled or submitting as a guest user without checkout. This is because when the payment feature is enabled, the user is always redirected to the WooCommerce checkout page.

In addition, we recommend adding the code to functions.php of a child theme and not to that of the original theme. If you add the code to functions.php of the original theme, you will lose the modifications when you update the theme. For details on child themes, see https://codex.wordpress.org/Child_Themes

We have a listing that belongs to multiple categories, but none of them or only one of them is displayed on the listing page. The same is happening to locations, tags, and photos.

If your directory has payment features enabled, and the listing does not belong to any payment plan, you will need to configure the “Max number of categories allowed” setting (or locations/tags/photos) from Directories -> [Your Directory] -> Content Types -> Listing -> Edit -> Payment.

If the listing does have a payment plan associated, then you will need to edit the same setting for the payment plan from the Products section of WooCommerce.

I would like to remove the author from all listings in my directory.

In order to remove the author from all existing listings in your directory, you can issue the following SQL against your database:

UPDATE wp_posts SET post_author = 0 WHERE post_type = 'xxx_dir_ltg';

Where xxx is the machine name of your directory. You can check the machine name of your directory from the “Directories” page in the backend. The string in parenthesis with lower case characters is the machine name of your directory, for example directory.

In addition, if your database is using a custom database table prefix, make sure to change the wp_ part of the wp_posts table name in the SQL to your custom database table prefix.

How can I change the image dimension of thumbnails/icons generated by Directories Pro?

Directories Pro uses the following code to register the image dimension for cropped thumbnails:
add_image_size('drts_thumbnail', 240, 180, true);
and the following for scaled version of thumbnails:
add_image_size('drts_thumbnail_scaled', 240, 180, false);
and for icons:
add_image_size('drts_icon', 32, 32, true);
add_image_size('drts_icon_lg', 48, 48, true);
add_image_size('drts_icon_xl', 80, 80, true);
You can simply override them by adding the following code to functions.php of your theme (child theme) for example (320×240 px):
add_action('init', function() {
    add_image_size('drts_thumbnail', 320, 240, true);
    add_image_size('drts_thumbnail_scaled', 320, 240);
}); 

For medium/large sized images, you can configure them from Settings -> Media.

Make sure to regenerate thumbnails/icons after making the changes, using a 3rd plugin such as the Regenerate Thumbnails plugin.

How can I allow claiming a listing that already has an author assigned?

Please follow these steps:

1. Go to Directories -> [Your Directory] -> Content Types -> Listing -> Manage Fields and create a new “ON/OFF” type field.

2. Configure the field as shown in the screenshot below. You can change the labels but make sure the field name is set to “field_claimable” for the code in the next step to work properly.

3. Add the following code to functions.php of your theme:

add_filter('drts_claiming_is_entity_claimable', function($result, $entity) {
    if (!empty($entity->field_claimable[0])) {
        $result = true;
    }
    return $result;
}, 10, 2);

That’s all you need to do. Listings can now be claimed by other users even when an author is already assigned, if the field created in step 1 is checked. You (as admin or listing author) can check/uncheck the field when you add/edit listings.

In addition, if you wish to automatically uncheck the field for a listing when a claim for the listing is approved, you can add the following code to functions.php of your theme:

add_action('drts_claiming_claim_approved', function($claim, $claimedEntity) {
    drts()->Entity_Save($claimedEntity, ['field_claimable' => false]);
}, 10, 2);

In addition, we recommend adding the code to functions.php of a child theme and not to that of the original theme. If you add the code to functions.php of the original theme, you will lose the modifications when you update the theme. For details on child themes, see https://codex.wordpress.org/Child_Themes

How can I display bookmarked listings/reviews only on a separate page, including bookmarks by guest users?

You can add a new view from Directories -> [Your Directory] -> Content Types -> Listing (or Review) -> Manage Views. In the view configuration form, switch on the “Show bookmarked items only” setting under the “Query Settings” tab. You can then use the [drts-directory-view] shortcode generated for the view on a new WordPress page.

You can see how it works on our demo site:
- Bookmarked listings: https://demo.directoriespro.com/bookmarks/
- Bookmarked reviews: https://demo.directoriespro.com/bookmarked-reviews/

For more details on views, please see https://directoriespro.com/documentation/getting-started/displaying-content-with-views.html

How can I remove the related posts section added by Jetpack on single listing/review pages?

You can add the following code to functions.php of your theme:

add_filter('jetpack_relatedposts_filter_options', function ($options) {
    if (is_singular('xxx_dir_ltg')) $options['enabled'] = false;
    return $options;
});

Where xxx_dir_ltg is the content type (or post type) name for listings in your directory. You can check the content type name of your directory from Directories -> [Your Directory] -> Content Types in the backend.

My taxonomy term (category/location/tag) pages are not displaying listings at all.

This is most likely an issue caused by a conflict with the theme that you are currently using. Please try adding one or more of the following lines of code to functions.php of your theme and see if this resolves the issue.

add_filter('drts_wordpress_archive_force_singular', '__return_true');
add_filter('drts_wordpress_archive_force_is_page', '__return_true');
add_filter('drts_wordpress_archive_force_is_not_archive', '__return_true');

How to add lightbox effect to photos and images?

First, go to Directories -> [Your Directory] -> Content Types -> Listing -> Manage Displays -> Detailed and edit the display element that shows photos or images, for example the default “Photos” display element. Select “Gallery” for the “Field renderer” setting and save the display element. This tells Directories Pro to use the WordPress [gallery] shortcode to display photos and images.

Then install the Responsive Lightbox & Gallery plugin which turns the [gallery] shortcode into a nice gallery with lightbox effect. Configure the plugin to customize the look of the gallery displayed.

Is FontAwesome Pro supported?

Yes, in order to use the FontAwesome Pro version, download the latest icon package for the Pro version (FontAwesome v5 only) from https://fontawesome.com/ and upload fontawesome.min.css and the webfonts folder (and all its font files inside) to wp-content/drts/assets as shown below.

wp-content/
  drts/
    assets/
      fontawesome.min.css
      webfonts/
        fa-brands-400.eot
        fa-brands-400.svg
        fa-brands-400.tff
        fa-brands-400.woff
        fa-brands-400.woff2
        ...
        fa-duotone-900.eot
        ...
        fa-light-300.eot
        ...
        fa-regular-400.eot
        ...
        fa-solid-900.eot
        ...

You may also need to run the “Clear cache” tool from Directories -> System -> Tools.

How to show only listings that are near the current user location on initial page load?

You can select one of either the server-side geolocation or client-side geolocation method.

Server-side geolocation (v1.3.73 or later)

Server-side geolocation uses a 3rd party geolocation API to fetch the current location of the user based on the IP address (IP Geolocation). It may not be possible to fetch the accurate location of the user depending on the network as well as the API used.

1. Install and activate the “Geolocation IP Detection” plugin (https://wordpress.org/plugins/geoip-detect/) and then configure the plugin from Settings -> Geolocation IP Detection.

2. Go to Directories -> Settings -> Map -> Map API Settings and select “WordPress Geolocation IP Detection plugin” for the “Geolocation API” setting. If you are not seeing such a setting, please try running the “Reload components” and “Clear cache” tool from Directories -> System -> Tools

3. Edit your view from Directories -> [Your Directory] -> Content Types -> Listing -> Manage Views, click the “Query Settings” tab and under the “Query by field” setting, enter _current_user_,20 for example which tells the view to display listings within 20 (km or mi) from the user’s current location.

Or if you simply wish to show all listings closest from the current user’s location, enter _current_user_ only and select “Distance” for the “Default sort order” setting under the “Sort Settings” tab.

Client-side geolocation

Client-side geolocation uses the user’s browser to fetch the current location of the user (HTML Geolocation). Therefore depending on the user’s browser or network settings, it may not be possible to fetch the current location of the user.

1. Edit your view from Directories -> [Your Directory] -> Content Types -> Listing -> Manage Views and make sure that the filter form is enabled under the “Filter Settings” tab.

2. Go to Directories -> [Your Directory] -> Content Types -> Listing -> Manage Views -> Manage Filters and make sure the “Location” filter is added with both the “Add Search my location button to map” and “Click Search my location button automatically on page load” options are switched on.

Reviews stopped working for my listings!

Please first make sure that you have enabled reviews as instructed in the documentation. https://directoriespro.com/documentation/interacting-with-users/reviews.html

If your directory has payment features enabled, please make sure to switch on the “Enable reviews” option for your payment plans to enable reviews. For listings without a payment plan, you can switch on the same option under Directories -> [Your Directory] -> Content Types -> Listing -> Edit -> Payment -> Default Feature Settings.

How can I change the URL of the “Add Listing” button to a custom page URL?

You can add the following code to functions.php of your theme. Make sure to change the URL_to_your_page part to your custom page URL.

add_filter('drts_view_nav_add_entity_button_url', function ($url, $bundle) {
    if ($bundle->type === 'directory__listing') {
        $url = 'http://URL_to_your_page';
    }
    return $url;
}, 10, 2);

We recommend adding the code to functions.php of a child theme and not to that of the original theme. If you add the code to functions.php of the original theme, you will lose the modifications when you update the theme. For details on child themes, see https://codex.wordpress.org/Child_Themes

There are multiple directories on our site. How can I skip the directory selection form and go directly to the add listing form when submitting a listing from the frontend?

That is possible by appending bundle=xxx_dir_ltg to the URL of your add listing page, where “xxx_dir_ltg” is the content type name of listings in your directory. You can check the content type name from Directories -> [Your Directory] -> Content Types.

For example, on our demo site: https://demo.directoriespro.com/add-directory-listing/?bundle=directory_dir_ltg

How can I show a map on the single listing page?

It should be displayed by default if your directory has locations enabled when you created your directory.

If not, you can add a display element for the default “Location” field (or custom “Location” or “Map” type field) from Directories -> [Your Directory] -> Content Types -> Listing -> Manage Displays -> Detailed. Please make sure to select “Map renderer” for the “Field renderer” setting which will show a map. For more details on displays, please see https://directoriespro.com/documentation/getting-started/managing-and-customizing-displays.html

I am using the “Directories: Filter Form” widget in a sidebar. On mobile devices, is it possible to hide the widget and instead show the filter form above listings?

Yes, that is possible by following the steps below.

1. Go to Appearance -> Widgets, edit your “Directories: Filter Form” widget and check the “Hide on mobile” option.

2. Go to Directories -> [Your Directory] -> Content Types -> Listing -> Manage Views, edit the view that is currently set as the default view and switch on the “Show filter form” and “Show filter form on mobile only” settings under the “Filter Settings” tab.

I would like listings and reviews submitted by users to require manual approval by administrator.

Please go to Directories -> [Your Directory] -> Permissions in the backend. You can then revoke the “Publish Listings” permission from user roles that you wish to have their listings to require manual approval by administrator. For reviews, click the “Reviews” sub-tab and do the same with the “Publish Reviews” permission.

For more details on permissions, please see https://directoriespro.com/documentation/additional-features-and-settings/permissions.html

My directory is an event directory and each listing has an event date field. How can I display listings that have a future date for that field?

You can edit the view displaying your listings from Directories -> [Your Directory] -> Content Types -> Listing -> Manage Views, and under the “Query Settings” tab, select your event date field for the “Query by field” setting and enter the following into the text field:

now,

The comma at the end is required. This tells the view to fetch listings that have a future date (a date later than “now”) selected for the field.

Is it possible to use Bootstrap loaded by my theme instead of the one included with Directories Pro?

Yes, this is possible by using the “drts_bootstrap_handle” filter hook.

add_filter('drts_bootstrap_handle', '__return_true');

You can add the code above to functions.php of your theme.

Also if the handle name of Bootstrap CSS/JS files enqueued by your theme is something other than “bootstrap”, please make sure to return the name for both CSS and JS files, for example:

add_filter('drts_bootstrap_handle', function(){
    return [
        'css' => 'bootstrap_css_handle_name', 
        'js' => 'bootstrap_js_handle_name',
    ];
});

I am getting an error message “The link you followed has expired.” when installing the plugin.

This does seem to happen when the max_upload_file of PHP on your server is set very low. This isn’t a bug but a matter of server settings and you should increase that limit to at least 5MB, otherwise even uploading a larger image file could cause the same issue.

You can either contact your hosting company and ask them to increase it for you or read the following article about how to do it yourself: http://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/

I am getting the following error on the checkout page: Table ‘xxxx.wp_drts_payment_featuregroup’ doesn’t exist

For some reason one or more of the database tables required by the Directories Payments plugin are not created in your database. Please first try running the “Reload components” tool from Directories -> System -> Tools and see if this fixes the issue.

If the issue persists, you will need to manually issue the following SQL queries against your WordPress database using a database management software such as phpMyAdmin on your server.

CREATE TABLE IF NOT EXISTS `wp_drts_payment_feature` (
  `feature_status` int(1) unsigned NOT NULL DEFAULT '0',
  `feature_feature_name` varchar(50) NOT NULL DEFAULT '',
  `feature_metas` text NOT NULL,
  `feature_logs` text NOT NULL,
  `feature_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `feature_created` int(10) unsigned NOT NULL DEFAULT '0',
  `feature_updated` int(10) unsigned NOT NULL DEFAULT '0',
  `feature_featuregroup_id` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`feature_id`),
  KEY `feature_featuregroup_id` (`feature_featuregroup_id`)
) ENGINE=InnoDB;

CREATE TABLE IF NOT EXISTS `wp_drts_payment_featuregroup` (
  `featuregroup_logs` text NOT NULL,
  `featuregroup_bundle_name` varchar(40) NOT NULL DEFAULT '',
  `featuregroup_order_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  `featuregroup_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `featuregroup_created` int(10) unsigned NOT NULL DEFAULT '0',
  `featuregroup_updated` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`featuregroup_id`),
  KEY `featuregroup_bundle_name` (`featuregroup_bundle_name`)
) ENGINE=InnoDB;

If your database is using a database table prefix other than the default wp_, make sure to replace the wp_ part in the above queries with your custom database table prefix.

I am getting the following error on the checkout page: Table ‘xxxx.wp_drts_entity_field_claiming_status’ doesn’t exist

For some reason one of the database tables required by the claiming feature is not created in your database. Please first try running the “Reload components” tool from Directories -> System -> Tools and see if this fixes the issue.

If the issue persists, you will need to manually issue the following SQL queries against your WordPress database using a database management software such as phpMyAdmin on your server.

CREATE TABLE `wp_drts_entity_field_claiming_status` (
  `entity_type` varchar(40) NOT NULL DEFAULT '',
  `bundle_name` varchar(40) NOT NULL DEFAULT '',
  `entity_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  `field_name` varchar(150) NOT NULL DEFAULT '',
  `weight` int(10) unsigned NOT NULL DEFAULT '0',
  `value` varchar(10) NOT NULL DEFAULT '',
  PRIMARY KEY (`entity_type`,`entity_id`,`field_name`,`weight`),
  KEY `bundle_name` (`bundle_name`),
  KEY `entity_id` (`entity_id`),
  KEY `weight` (`weight`),
  KEY `value` (`value`)
) ENGINE=InnoDB;

If your database is using a database table prefix other than the default wp_, make sure to replace the wp_ part in the above query with your custom database table prefix.

I am getting the following error: Table ‘xxxx.wp_drts_entity_field_date’ doesn’t exist

For some reason, one of the database tables required is not created in your database. Please go to Directories -> [Your Directory] -> Content Types -> Listing -> Manage Fields, create a new “Date” type field, then delete that field if you do not need the field.

How do I display Google Maps place rating and review count for each listing?

Make sure “Google Maps” is selected for the “Map provider” setting in Directories -> Settings -> Map -> Map API Settings, and both the server and browser API keys are configured as instructed in the documentation (https://directoriespro.com/documentation/getting-started/installation.html#obtaining-a-google-maps-api-key). Also make sure the “Places API” library is enabled for your API project on Google API console if not yet enabled.

Go to Directories -> [Your Directory] -> Content Types -> Listing -> Manage Fields and create a “Single Line Text” field and select “Must be a valid Google Maps place ID” for the “Character validation” setting. Then, create a display element for the field from Directories -> [Your Directory] -> Content Types -> Listing -> Manage Displays and set the “Field renderer” setting to “Google Maps place rating”.

You must enter a valid Google Maps place ID into the field that you created when you add/edit listings. You can find your Google Maps place ID here: https://developers.google.com/maps/documentation/javascript/examples/places-placeid-finder

How do I change the bookmark icon from a heart to something else?

You can add the following code to functions.php of your theme, which will change the icon to a bookmark tag icon:

add_filter('drts_voting_type_info', function ($info, $type) {
    if ($type === 'bookmark') {
        $info['icon'] = 'far fa-bookmark';
        $info['icon_active'] = 'fas fa-bookmark'; /
    }
    return $info;
}, 10, 2);

If you wish to change it to a star, modify the fa-bookmark part of the code to fa-star.

We recommend adding the code to functions.php of a child theme and not to that of the original theme. If you add the code to functions.php of the original theme, you will lose the modifications when you update the theme. For details on child themes, see https://codex.wordpress.org/Child_Themes

Is it possible to change the status to published from pending when a listing is edited form the frontend dashboard?

Yes, this is possible by adding the following line of code to functions.php of your theme:

add_filter('drts_dashboard_edit_post_pending', '__return_true');

This will change the status of the listing edited from the frontend dashboard to pending, if the user does not have the “Publish Listings” permission in your directory.

You can also create a notification that is sent whenever a listing is updated, using the “Better Notifications for WordPress” plugin (https://wordpress.org/plugins/bnfw/).

How can I import the geolocation data for listings so that they can be displayed on the map?

When importing listings, make sure that you have a full address column in your CSV and associate that column with the “Full Address” sub-field of the “Location (location_address)” field in the 2nd step of the importer. Then switch on the “Geocode address” option under “Location (location_address)” -> FULL ADDRESS in the 3rd step of the importer.

You can also run the “Load geolocation data” tool from Directories -> System -> Tools to load lat/lng coordinate values for all existing listings in bulk.

Either way, make sure that you have the “Geocoding API” setting selected in Directories -> Settings -> Map API Settings.

For more details on importing, please see https://directoriespro.com/documentation/exporting-and-importing-directories/exporting-and-importing-content.html

My site is hosted on WP Engine and the reset password feature of Directories Pro does not work!

This is most likely caused by the server level caching feature of WP Engine. WP Engine will disable caching on certain pages if you provide the URLs that should be excluded. Please contact them and provide the following URLs and see if that resolves the issue.
https://[URL_to_your_login_registration_page]/reset_password/
https://[URL_to_your_login_registration_page]/lost_password/

How to automatically approve claims submitted?

You can add the following code to functions.php of your theme:

add_filter('drts_claiming_claim_status', '__return_true');

How do I change the background color of the default photo slider on the single listing page which is currently black?

You can add the following CSS for example to Directories -> Settings -> Appearance -> Custom CSS, or style.css of your theme, which will change the background color to white (#fff).

.drts-slider-photos-photo-no-padding {
    background-color: #fff;
}

I am getting an error which states “Illegal mix of collations (utf8mb4_unicode_520_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) ...”

In order to fix this issue, please go to Directories -> System -> Tools, click the “Change table collation” button, select “utf8mb4_unicode_ci” and press the “Run Tool” button.

I am using the Astra theme, but SEO settings are ignored on Directories Pro taxonomy term pages.

Please first download the child theme for Astra from https://directoriespro.com/astra-child.zip.

If you are currently not using a child theme for Astra, you can simply install and activate this theme.

If you are already using a child theme of Astra, unzip the zip file and copy drts-term.php in the astra-child folder to your child theme folder, then add the following lines of code to functions.php of your child theme.

add_filter('drts_wordpress_the_content_filter_once', '__return_true');
add_filter('drts_wordpress_archive_force_singular', '__return_false');
add_filter('drts_wordpress_archive_force_queried_object_id', '__return_false');

I am using the Hello Elementor theme, but SEO settings are ignored on Directories Pro taxonomy term pages.

Please first download the child theme for Hello Elementor from https://directoriespro.com/hello-elementor-child.zip.

If you are currently not using a child theme for Hello Elementor, you can simply install and activate this theme.

If you are already using a child theme of Hello Elementor, unzip the zip file and copy drts-term.php in the hello-elementor-child folder to your child theme folder, then add the following code to functions.php of your child theme.

add_filter('drts_wordpress_the_content_filter_once', '__return_true');

Show more

Contact the author

This author provides limited support for this item through email contact form.

Item support includes:

  • Availability of the author to answer questions
  • Answering technical questions about item’s features
  • Assistance with reported bugs and issues
  • Help with included 3rd party assets

However, item support does not include:

  • Customization services
  • Installation services

View the item support policy

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey