1. Home
  2. GeoDirectory Pages and Templates
  3. Search Archive Template

Search Archive Template


Introduction
Troubleshooting
Frequently Asked Questions
Support

Introduction

What

The Search Archive template is a WordPress page. The contents of the page are the GeoDirectory Elements that are used to display listings. The Search Archive page template shows search results in the form of lists of listings with the GD Loop Design Element. The Search Archive template starts with the slug of /search/.

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 GD Search results are viewed on the frontend, the contents of the GD Search Archive template is queried, and each Element is rendered.

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 Search 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 titled Search, hover, and then edit the page.

Examples

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

GeoDirectory Settings

Default Template Setting

Choose the default GD Search template in the Pages settings:

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

Slug

Adjust the slug for the search page by editing the page and looking for the permalinks option in the right hand sidebar. If you are using BuddyPress, be sure to change the slug to something else like /location-search/.

Personalize

GeoDirectory Design Elements

The following GD Elements are commonly used in the Search 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. It is recommended not to use “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

Sorting only applies to CPT Archive pages. Search results do not have sorting options. Read more about CPT Archive sorting options here.

Builders

You can absolutely use an advanced theme builder on the Search Archive. The layout must be setup as an “Archive” and assigned to the site search function. The layout will also takeover the default site search. 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 Search Archive listing template with PHP. See our page here to get started.

Was this helpful to you? Yes 1 No 1