1. Home
  2. Docs
  3. GeoDirectory Pages and Templates
  4. Archive Page Template

Archive Page Template



Introduction
Troubleshooting
Frequently Asked Questions
Support

Introduction

What

The Archive template is a WordPress page. The contents of the page are the GeoDirectory Elements that are used to display listings. The Archive page template shows lists of listings with the GD Loop Design Element. The Archive template is used on Custom Post Type Archives like /places/ as well as Custom Post Types Category archives like /places/category/attractions/.

Inside the template you will find default Elements that are installed with GD including GD Loop, GD Loop Actions, and GD Loop Paging. Each of these Elements is responsible for showing one specific feature.

Every time a listing is viewed on the frontend, the contents of the GD Archive template are queried, and each Element is rendered with the data of the listing at the URL being viewed.

The ‘mini listings’ shown by GD Loop are based on the Archive Item template. You can find the Archive Item doc here.

Where

The GD Archive template is a WordPress page that is installed with GeoDirectory.
You can find the page by searching in the the Pages on your site in:

WordPress Backend – Pages – Search “gd” – Find the page titles GD Archive, hover, and then edit the page.

Examples

Directory Starter – https://wpgeo.directory/starter/places/
Supreme Directory – https://wpgeo.directory/supreme-directory/places/

GeoDirectory Settings

Default Template Setting

Choose the default GD Archive template in the Pages settings:

GeoDirectory – Settings – General – Pages – Detail template – Choose your template page

Custom Post Types Archive Template Override

When using the Custom Post Type addon, it is possible to set a different Archive template for each Custom Post Type (CPT). The setting for this is found in:

CPT Settings (ex. Places Settings) – General (tab) – Show Advanced – Archive template – Choose your template page

Permalinks

Adjust the URL pattern for your archive pages. You can read more about permalinks and URL patterns here.

Archive Links with Location Manager

When the Location Manager is installed, there are additional options for controlling taxonomy links. You can find these options on the Locations tab. Read more about the Locations Manager settings here.

Personalize

GeoDirectory Design Elements

The following GD Elements are commonly used on the Archive template.

GD Loop Actions – Sorting Options and Layouts selector.
GD Loop – Shows the main query for the Archive page, resulting in listings on the page.
GD Loop Paging – Paging options to page through the listings shown on the page.
GD Map – Use an Archive map type to show the listings on the page. Choose “all_posts=1” to show all the posts.
GD Notifications – show notifications created by GD.

Default Content

When GeoDirectory is installed, the template is installed with default content. If you make changes to the page, and want to restore the default content, you can find it in the GeoDirectory Settings:

GeoDirectory – Settings – General – Pages – Click “Default Content”

The default content will be shown in a lightbox modal. You can copy and paste the default content back into the Page, overwriting anything you already have in the page.

Sorting

Each CPT can have one or more “Sorts”. If they are active they will be shown in the dropdown created by GD Loop Actions. Read more about CPT Archive sorting options here.

GD Recently Viewed

Show listings that the visitor has recently viewed with the GD Recently Viewed element.

GD Recent Reviews

Show recent reviews with the GD Recent Reviews element.

Max Posts to Display

Show more posts on the CPT Archive and Search Archive by adjusting the WordPress settings.

WordPress Backend – Settings – Reading – Blog pages show at most -> (Set this number to your requirements)

If that setting doesn’t have an impact, you may be using one of the rare themes that has an override for this setting. Divi, for one, has a general setting for max posts, so use that setting instead to change the posts per page.

Builders

You can absolutely use an advanced theme builder on the Archive page template. See more information here on the builders doc.

Pages Templates and Sidebars

GD Uses the sidebars that come with your theme. Read more about how to choose a theme that has the sidebars you want here.

Customize

Customize with PHP Templates

You can create the Archive listing template with PHP. See our page here to get started.

Was this article helpful to you? Yes No 1