Code

Support for Directories Pro plugin for WordPress

onokazu

onokazu supports this item

Supported

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 in wp-config.php:

define('WP_DEBUG', false);

to

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

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

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

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.

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

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.

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

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

add_filter('drts_social_medias', function($medias) {
    $medias['vkontakte'] = [
        'type' => 'textfield',
        'label' => 'VKontakte',
        'icon' => 'fab fa-vk',
        'default' => 'vkontakte',
        'placeholder' => 'Enter VKontakte username.',
    ];
    return $medias;
});
add_filter('drts_social_media_url', function($url, $name, $value) {
    if ($name === 'vkontakte') {
        $url = 'https://vk.com/' . $value;
    }
    return $url;
}, 10, 3);

After adding the code, make sure to clear the cache from Directories -> System -> Tools. Then, enable Vkontakte 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 do I set a custom color for the search form submit button?

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;
    border-color: #467fcf;
}

How can I try out the development build?

If you are interested in trying out the development build of Directories Pro, you can add the following line of code to wp-config.php of your WordPress site.

define(‘DRTS_UPDATER_VERSION_PREF’, ‘dev’);

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

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

This will tell the plugin updater to fetch new package information of Directories Pro from the development branch of our server. You will then soon receive a new update notification and should be able to update to the latest development build.

However, please do note that if you update to the development build, for example to 1.2.0-dev.123, the next stable version will be 1.2.0 and you are no longer able to downgrade to the current version of the stable branch unless you re-install Directories Pro.

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) {
    $src = 'http://url_to_your_custom_image_file';
    return $src;
});

Make sure to replace http://url_to_your_custom_image_file in the code above with the URL of your custom image file.

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

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

If you wish to show page view count for each listing in Directories Pro, you can install the Post Views Counter plugin or the WordPress Popular Posts plugin. 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 views for each post 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 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

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