Customizing Pages

Directory pages and single post/term pages can be customized using shortcodes.

Customizing directory pages

Directory pages can be customized by editing the page assigned to each directory page in Directories -> Settings -> Pages.

For example, here is how you can add a notice above the directory index page of your directory.

  1. Login to your website if not yet logged in and go to the WordPress administration dashboard.

  2. Click Directories in the admin sidebar.

  3. Click the Settings tab and then the Pages sub-tab.

  4. Scroll down to Page Settings and copy the shortcode shown under the dropdown field for your directory.

  5. Click the Edit link next to the dropdown field to edit the page. Paste the shortcode copied in step 4 to the content section of the page and add a custom notice message above the shortcode.

  6. Update the page, and the page will now look like below in the frontend.

Customizing single post/term pages

In order to customize single post and term pages, a separate page needs to be assigned first to each post type or taxonomy.

Here is how you can assign a page for listings:

  1. Login to your website if not yet logged in and go to the WordPress administration dashboard.

  2. Click Directories in the admin sidebar.

  3. Under the All Directories tab, click the gear icon in the row of the directory that you wish to configure.

  4. Under the Content Types tab, click the Edit button in the Listing row.

  5. Scroll down to Single Item Page Settings and select a page from the Assign page dropdown field.

  6. Scroll further down and click Save Changes.

You can now edit the page to customize how a listing is rendered on the single listing page.

You can add custom content to the content section of the page, however when you do so make sure to insert the [drts-entity] shortcode where the listing content should be displayed.

[drts-entity] shortcode

This shortcode will display the full content of the post/term currently viewed when used without any parameter.

[drts-entity]

If you are editing the content section of the page, make sure to insert the shortcode to where the full content of the post/term currently viewed should be displayed.

You can also use the shortcode to output a single field value or a partial content rendered by a display element for the currently viewed post/term. This is useful for example when you want to use a page builder plugin to fully design how the field values and content of a post/term is displayed on the single item page.

Displaying a field value

Use the field parameter to display a value of a specific field of the currently viewed post/term.

[drts-entity field="xxx"]

where xxx represents the name of field to display. This will output a human readable text value of the specified field for the currently viewed post/term.

Note that not all field types are supported by this method.

Displaying a display element

Use the display_element parameter to show a display element of the Detailed display.

[drts-entity display_element="xxx"]

where xxx represents the ID of a display element.

For example, follow the steps below to get the shortcode for a display element of the Detailed display of listings.

  1. Login to your website if not yet logged in and go to the WordPress administration dashboard.

  2. Click Directories in the admin sidebar.

  3. Under the All Directories tab, click the gear icon in the row of the directory to edit.

  4. Under the Content Types tab, click the dropdown button in the Listing row and then click Manage Displays. Make sure the Detailed display is selected.

  5. Hover over to the display element that you wish to get a shortcode for and click the information button (turquoise colored button with "i").

  6. Copy the shortcode displayed in the popup box.

results matching ""

    No results matching ""