{"id":23018,"date":"2016-11-27T00:54:47","date_gmt":"2016-11-27T00:54:47","guid":{"rendered":"https:\/\/wpgeodirectory.com\/docs\/?p=23018"},"modified":"2018-03-19T09:25:15","modified_gmt":"2018-03-19T09:25:15","slug":"gd-search","status":"publish","type":"post","link":"https:\/\/wpgeodirectory.com\/docs\/gd-search\/","title":{"rendered":"The GD Search explained"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv5.png\" alt=\"\" width=\"682\" height=\"70\" \/><\/p>\n<h4>On this page:<\/h4>\n<p><a class=\"cnt1\" href=\"#cpt\">1. Custom Post Type selector<\/a> <a class=\"cnt1\" href=\"#cat\">2. Category selector<\/a> <a class=\"cnt1\" href=\"#search\">3. &#8220;Search for&#8221; field<\/a> <a class=\"cnt1\" href=\"#near\">4. &#8220;Near&#8221; field<\/a> <a class=\"cnt1\" href=\"#compass\">5. The &#8220;Near me&#8221; compass<\/a> <a class=\"cnt1\" href=\"#custom\">6. Filtering with custom fields<\/a>\u00a0<a class=\"cnt1\" href=\"#select\">Adding a Select custom field to the search bar<\/a><\/p>\n<p><i class=\"fa fa-lightbulb-o fa-2x\" style=\"color: green;\"><\/i> <span style=\"color: #008000;\">Read\u00a0<a style=\"color: #008000;\" href=\"https:\/\/wpgeodirectory.com\/docs\/searching-and-browsing\/\">Understanding navigation, searching and browsing \u2026<\/a> to understand the basic search function better.<\/span><\/p>\n<h3><a id=\"cpt\"><\/a>1. Custom Post Type (CPT) selector<\/h3>\n<p><img loading=\"lazy\" class=\"greenborder alignleft\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv6.png\" width=\"192\" height=\"132\" \/>This selector will only be shown\u00a0if you have more than one <a href=\"https:\/\/wpgeodirectory.com\/docs\/category\/addons\/custom-post-types\/\">Custom Post Type<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<ol>\n<li>The CPT selector defaults to the current CPT of a <a href=\"https:\/\/wpgeodirectory.com\/docs\/layout\/#directory\">Listings, detail or search page<\/a>. For example on an Events category page, Events will be listed first in the selector.<\/li>\n<li>On a <a href=\"https:\/\/wpgeodirectory.com\/docs\/layout\/#directory\">location<\/a> page or any standard WP page or post, the order of the CPTs in the selector can be determined by changing the order at <em><strong>GD &gt; Custom Post Types &gt; Choose a CPT &gt; Advance Mode tab &gt;\u00a0Order in post type list\u00a0<\/strong><\/em>(<a href=\"https:\/\/wpgeodirectory.com\/downloads\/custom-post-types\/\">Custom Post Types addon<\/a> required).<\/li>\n<\/ol>\n<h3><a id=\"cat\"><\/a>2. Category selector<\/h3>\n<p><img loading=\"lazy\" class=\"greenborder alignleft\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv7.png\" alt=\"\" width=\"232\" height=\"118\" \/>The categories drop down can be set up for each Custom Post Type and the Advanced Search addon is required.<\/p>\n<div style=\"clear: both;\"><\/div>\n<ol>\n<li>Activate the Advanced Search addon.<\/li>\n<li>Go to <em><strong>GD &gt; Place (or other CPT) Settings &gt; Custom Fields tab<\/strong><\/em>.<\/li>\n<li>Select Yes to include the categories drop down in the Advanced Search:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv8.png\" alt=\"\" width=\"513\" height=\"438\" \/><\/li>\n<li>Then go to the <strong>Advanced Search<\/strong> tab and click on the <strong>Category<\/strong> field on the left hand side, that will move it to the available fields on the right:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv9.png\" alt=\"\" width=\"416\" height=\"132\" \/><\/li>\n<li>Now open the <strong>Category<\/strong> field there, and select to <em><strong>Show in main search bar<br \/>\n<\/strong><\/em>:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv10.png\" alt=\"\" width=\"523\" height=\"170\" \/><\/li>\n<li>The <em><strong>Search bar priority<\/strong><\/em> setting allows you to move the Category selector left or right in the main search bar.<\/li>\n<\/ol>\n<h3><a id=\"search\"><\/a>3. &#8220;Search for&#8221;\u00a0field<\/h3>\n<ol>\n<li>GD will check the\u00a0entry\u00a0<strong>titles, description and taxonomies (tags and categories)<\/strong> of the listings.<\/li>\n<li>The search will <span style=\"color: #ff0000;\"><em><strong>not<\/strong><\/em><\/span> check custom fields or <a href=\"https:\/\/wpgeodirectory.com\/docs\/definitions\/#location\">locations<\/a>.<\/li>\n<li>The search will only search one Custom Post type at the time.<\/li>\n<li>With the Advanced Search addon, you can set this field to auto-suggest listings based on the title of the listings, see <a href=\"https:\/\/wpgeodirectory.com\/docs\/search-filters-overview\/#search\">Search Autocompleter<\/a> settings.<\/li>\n<li>You can change the default text at <em><strong>GD &gt; Design &gt; Search<\/strong><\/em>.<\/li>\n<\/ol>\n<h3><a id=\"near\"><\/a>4. &#8220;Near&#8221; field<\/h3>\n<ol>\n<li>When you enter a location in the <em><strong>Near<\/strong><\/em> field, GD will calculate the center of that location.<\/li>\n<li>GD then will look for all listings within an area with a\u00a0default that match the <em><strong>Search for<\/strong><\/em> criteria.<\/li>\n<li>Your default search area is set at <em><strong><a href=\"https:\/\/wpgeodirectory.com\/docs\/core-general\/#search\">GD &gt; General &gt; Search<\/a>.<\/strong><\/em><\/li>\n<li>The default GD search is not an <em><strong>IN<\/strong><\/em> search, but a search <em><strong>NEAR THE CENTER OF<\/strong><\/em>.<br \/>\nFor example, assuming your search area\u00a0is set to 40 square miles:<\/p>\n<ol>\n<li>If you enter <em><strong>World Trade Center<\/strong><\/em>, you will get listings around that building.<\/li>\n<li>If you enter United States, you will get listings somewhere around Buffalo in Kansas, because that is where Google situates the center of the United States.<\/li>\n<li>If you enter California,\u00a0you will get listings somewhere\u00a0in the Sierra National Forest.<\/li>\n<\/ol>\n<\/li>\n<li><i class=\"fa fa-exclamation-triangle fa-2x\" style=\"color: orange;\"><\/i> <strong>Be aware of some issues:<\/strong>\n<ol>\n<li>If you enter a ZIP or a postcode, be aware that that postcode might be used by different countries in the world and might return results around the center of a city in a different country.<\/li>\n<li>A similar\u00a0issue might occur for place names of cities in different countries.<\/li>\n<li>Please review <a href=\"https:\/\/wpgeodirectory.com\/docs\/core-general\/#specific\">Add location specific text to (Near) search for Google<\/a>.<\/li>\n<\/ol>\n<\/li>\n<li>Although the default search for this field is a\u00a0<em><strong>NEAR THE CENTER OF <\/strong><\/em>search, with the Advanced Search addon, you can set this field to auto-suggest locations\u00a0based on the title of the listings, see <a href=\"https:\/\/wpgeodirectory.com\/docs\/search-filters-overview\/#near\">Near Autocompleter<\/a> settings.<br \/>\nPlease note that if you have the Location Manager addon activated, the <a href=\"https:\/\/wpgeodirectory.com\/docs\/search-filters-overview\/#near\">Near Autocompleter<\/a> will start giving suggestions as your visitor starts searching, which if selected will search <em><strong>IN<\/strong><\/em> the location being entered (ie the city or region in the address of the listing) and will not search an area <em><strong>NEAR THE CENTER OF<\/strong><\/em> that location\u201d<\/li>\n<li>You can change the default text at <em><strong>GD &gt; Design &gt; Search<\/strong><\/em>.<\/li>\n<\/ol>\n<h3><a id=\"compass\"><\/a>5. The &#8220;Near me&#8221; compass<\/h3>\n<ol>\n<li>This <em><strong>compass<\/strong><\/em> will only show if you have the Advanced Search addon active.<\/li>\n<li>It allows for the search to be limited or expanded by a radius around the visitor&#8217;s current location (if <em><strong>Near me<\/strong><\/em> is ticked) or near the center of the location selection in the Near field (if <em><strong>Near me<\/strong><\/em> is not ticked):<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv11.png\" alt=\"\" width=\"502\" height=\"140\" \/><\/li>\n<li>Also review the <a href=\"https:\/\/wpgeodirectory.com\/docs\/search-filters-overview\/#geolocation\">Geolocation<\/a> settings.<\/li>\n<\/ol>\n<h3><a id=\"custom\"><\/a>6. Filtering with custom fields<\/h3>\n<ol>\n<li>This\u00a0will only work\u00a0if you have the Advanced Search addon active.<\/li>\n<li>Create your custom fields at <strong><em>GD &gt; Place (or other CPT) Settings &gt; Custom Fields<\/em><\/strong>.<\/li>\n<li>Then navigate to the <em><strong>Custom fields<\/strong><\/em> tab and expand any custom field you would like to filter with search and tick the checkbox <em><strong>Include this field in filter<\/strong><\/em>:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv12.png\" alt=\"\" width=\"355\" height=\"206\" \/><\/li>\n<li>Then go to the <strong>Advanced Search<\/strong> tab and click on the custom\u00a0field on the left hand side, that will move it to the available fields on the right:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv13.png\" alt=\"\" width=\"407\" height=\"152\" \/><\/li>\n<li>Now open the field by clicking on it, and select the settings:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv14.png\" alt=\"\" width=\"537\" height=\"153\" \/><\/li>\n<li>Now clicking on the <em><strong>Search cogwheel<\/strong><\/em> will open the custom filter:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv15.png\" alt=\"\" width=\"420\" height=\"228\" \/><\/li>\n<li>Now\u00a0if your visitors click the search button in the example above, the results will return:\n<ol>\n<li>Listings from the <strong><em>Places<\/em><\/strong> CPT only,<\/li>\n<li>that are in the <em><strong>Attractions<\/strong><\/em> category, and<\/li>\n<li>have <em><strong>farm<\/strong><\/em> in the title, description, category or tag of the listing, and<\/li>\n<li>are around the center of <em><strong>Amsterdam<\/strong><\/em> (depending on the radius set in the system), and<\/li>\n<li>will be filtered to only return those listings that have <em><strong>dogs<\/strong><\/em>.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h4><a id=\"select\"><\/a>Adding a Select custom field to the search bar<\/h4>\n<ol>\n<li><a href=\"https:\/\/wpgeodirectory.com\/docs\/core-place-settings\/#select\"><em><strong>Select<\/strong><\/em><\/a> custom fields can also be added to the search bar &#8211; but only Select, not Multiselect or any other, they can only be added to the Customized Search section as explained above.<\/li>\n<li>Follow steps 1 to 4\u00a0from\u00a0<a href=\"#custom\">6. Filtering with custom fields<\/a>\u00a0above.<\/li>\n<li>Now open\u00a0your <em><strong>Select<\/strong><\/em> custom field\u00a0there, and select to <em><strong>Show in main search bar<br \/>\n<\/strong><\/em>:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv17.png\" alt=\"\" width=\"457\" height=\"119\" \/><\/li>\n<li>That will add the Select custom field to the main search bar:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/11\/adv16.png\" alt=\"\" width=\"401\" height=\"131\" \/><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This post explains the different GD Search options and how to implement them.<\/p>\n","protected":false},"author":1676,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,34],"tags":[],"amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/23018"}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/users\/1676"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/comments?post=23018"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/23018\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/media?parent=23018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/categories?post=23018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/tags?post=23018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}