{"id":712,"date":"2019-04-17T13:28:40","date_gmt":"2019-04-17T13:28:40","guid":{"rendered":"https:\/\/wpgeodirectory.com\/docs-v2\/archive-item-template\/"},"modified":"2019-10-18T17:45:42","modified_gmt":"2019-10-18T17:45:42","slug":"archive-item","status":"publish","type":"docs","link":"https:\/\/wpgeodirectory.com\/docs-v2\/templates\/archive-item\/","title":{"rendered":"Archive Item Template"},"content":{"rendered":"<style>\nh5 {\n  font-size: 1.2em;\n  font-weight: bold;\n  margin-top: 5px;\n  margin-bottom: 15px;\n}\nblockquote.gd-faq h5 {\n    display: block;\n    margin-top: 5px;\n    margin-bottom: 15px;\n    margin-left: -10px;\n    padding: 0px;\n    border: 1px solic #cccccc;\n    width: 100%;\n    color: #393939;\n    text-decoration: underline;\n}\nblockquote.gd-faq h5 a {\n    color: #393939;\n}\nblockquote.gd-faq {\n  padding: 15px!important;\n  margin: 20px!important;\n  border: 1px solid #cccccc !important;\n  background-color: #ffffff!important;\n  border-left: 10px solid #FFF7F3 !important;\n  10px 10px 10px -10px #cccccc !important;\n  border-radius: 0px 4px 4px 0px;\n}\n<\/style>\n<div class=\"embed-responsive embed-responsive-16by9\"><iframe title=\"GeoDirectory v2 design customization with Gutenberg, Elementor, Beaver Builder, Divi and more\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/o8zgcNwNKyY?feature=oembed&amp;wmode=opaque\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/div>\n<p><span class='bookmark-index'><br \/>\n<a href=\"#intro\">Introduction<\/a><br \/>\n<a href=\"#troubleshooting\">Troubleshooting<\/a><br \/>\n<a href=\"#faq\">Frequently Asked Questions<\/a><br \/>\n<a href=\"#support\">Support<\/a><br \/>\n<\/span><\/p>\n<h3><a name=\"intro\" href=\"#intro\">Introduction<\/a><\/h3>\n<h4>What<\/h4>\n<p>The Archive Item page template is a WordPress page that controls what shows up in the &#8216;mini listings&#8217; shown throughout the site.. The contents of the page are the GeoDirectory Elements that are used to display listing data for each listing. Inside the template you will find default Elements that are installed with GD including GD Post Images, GD Output Location and more. Each of these Elements is responsible for showing one specific feature.<\/p>\n<p>Every time GD Listings or GD Loop is used, the contents of the GD Archive Item template are queried, and each Element is rendered with the data of the listing at the URL being viewed.<\/p>\n<h4>Where<\/h4>\n<p>The GD Archive Item template is a WordPress page that is installed with GeoDirectory.<br \/>\nYou can find the page by searching in the the Pages on your site in:<\/p>\n<p><strong>WordPress Backend &#8211; Pages &#8211; Search &#8220;gd&#8221;<\/strong> &#8211; hover over the Archive Item page and click edit to edit the page.<\/p>\n<h4>Examples<\/h4>\n<p>Directory Starter &#8211; <a href=\"https:\/\/wpgeo.directory\/starter\/places\/\" rel=\"noopener noreferrer\" target=\"_blank\">https:\/\/wpgeo.directory\/starter\/places\/<\/a><br \/>\nSupreme Directory &#8211; <a href=\"https:\/\/wpgeo.directory\/supreme-directory\/places\/\" rel=\"noopener noreferrer\" target=\"_blank\">https:\/\/wpgeo.directory\/supreme-directory\/places\/<\/a><\/p>\n<p><a href=\"https:\/\/wpgeo.directory\/starter\/places\/united-states\/california\/san-francisco\/tasty-food-inc\/\" rel=\"noopener noreferrer\" target=\"_blank\">DIrectory Starter Archive Item on Archive page for Places CPT.<\/a><\/p>\n<p><a href=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/04\/ds-archive-item.jpg\"><img src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/04\/ds-archive-item.jpg\" alt=\"\" width=\"450\" class=\"alignnone size-full wp-image-729\" srcset=\"https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/04\/ds-archive-item.jpg 892w, https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/04\/ds-archive-item-300x89.jpg 300w, https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/04\/ds-archive-item-768x227.jpg 768w\" sizes=\"(max-width: 892px) 100vw, 892px\" \/><\/a><\/p>\n<p>GD Design Elements used in this Archive Item template shown above<\/p>\n<p>GD Post Images<br \/>\nGD Post Title<br \/>\nGD Post Favorite<br \/>\nGD Post Content<br \/>\nGD Post Badge<\/p>\n<h3>GeoDirectory Settings<\/h3>\n<h4>Default Template Setting<\/h4>\n<p>Choose the default GD Details template in the Pages settings:<\/p>\n<p><strong>GeoDirectory &#8211; Settings &#8211; General &#8211; Pages &#8211; Detail template &#8211; Choose your template page<\/strong><\/p>\n<h4>Custom Post Types Template Override<\/h4>\n<p>When using the Custom Post Type addon, it is possible to set a different Archive Item template for each Custom Post Type (CPT). The setting for this is found in:<\/p>\n<p><strong>CPT Settings (ex. Places Settings) &#8211; General (tab) &#8211; Show Advanced &#8211; Archive Item template &#8211; Choose your template page<\/strong><\/p>\n<h3>Personalize<\/h3>\n<h4>GeoDirectory Design Elements<\/h4>\n<p>The following GD Elements are commonly used on the Archive Item template<\/p>\n<p>GD Post Images &#8211; Display a single image or a slider<br \/>\nGD Post Title &#8211; Display the listing title as a link to the listing<br \/>\nGD Post Favorite &#8211; Display a link so visitors can add the listing to their list of favorites.<br \/>\nGD Post Content &#8211; Display the listing Description and set a max word count and design an optional &#8216;read more&#8217; link.<br \/>\nGD Post Badge &#8211; New (last 30 days), Featured, Verified (is_claimed), Twitter, Facebook, and Website.<br \/>\nGD Output Location &#8211; Listings &#8211; Easily display a list of custom fields in your archive item with a single Element by using the Custom Fields Settings.<br \/>\nGD Post Meta &#8211; Display custom fields, categories, or tags.<br \/>\nGD Archive Item Open and Close &#8211; Simple containers to design your archive item into one or more rows and columns. Helps make listings look good in list view and grid layouts.<\/p>\n<h4>Default Content<\/h4>\n<p>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:<\/p>\n<p><strong>GeoDirectory &#8211; Settings &#8211; General &#8211; Pages &#8211; Click &#8220;Default Content&#8221;<\/strong><\/p>\n<p>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.<\/p>\n<h3>More Design Options<\/h3>\n<h4>GD Output Location -> Listings<\/h4>\n<p>You can adjust the properties of listing Custom Fields in the <a href=\"https:\/\/wpgeodirectory.com\/docs-v2\/places\/custom\/\" rel=\"noopener noreferrer\" target=\"_blank\">CPT Custom Fields Settings as described here<\/a>. <\/p>\n<p>One of the options is to &#8220;<a href=\"https:\/\/wpgeodirectory.com\/docs-v2\/places\/custom\/#show\" rel=\"noopener noreferrer\" target=\"_blank\">Show in extra output locations<\/a>&#8220;.<\/p>\n<p>Once you have chosen to display fields in the &#8216;Listings&#8217; location, you will need to use the GD Output Location element in your Archive Item template to show those fields. Add the widget or shortcode to your Archive Item template and set it to display the &#8220;Listings&#8221; location.<\/p>\n<pre><code>[gd_output_location location=\"listing\"]<\/code><\/pre>\n<h3>Builders<\/h3>\n<p>You can use a builder on the Archive Item template. See more information <a href=\"https:\/\/wpgeodirectory.com\/docs-v2\/integrations\/builders\/\">here on the builders doc<\/a>.<\/p>\n<h3><a name=\"customize\" href=\"#customize\">Customize<\/a><\/h3>\n<blockquote class=\"gd-faq\">\n<h5><a href=\"#php\" name=\"php\">Customize with PHP Templates<\/a><\/h5>\n<p>You can create the Archive Item template with PHP. <a href=\"https:\/\/wpgeodirectory.com\/docs-v2\/faq\/customizing\/\">See our page here to get started<\/a>.\n<\/p><\/blockquote>\n<blockquote class=\"gd-faq\">\n<h5><a href=\"#\" name=\"\"><\/a><\/h5>\n<\/blockquote>\n<h4>Demo Content<\/h4>\n<p>The Archive Item from our demo<\/p>\n<pre><code>\r\n[gd_archive_item_section type='open' position='left']\r\n[gd_post_images type='image' ajax_load='true' link_to='post' show_logo='true' show_title=\"1\" ]\r\n[gd_archive_item_section type='close' position='left']\r\n[gd_archive_item_section type='open' position='right']\r\n[gd_post_title tag='h2']\r\n\r\n[gd_post_badge key=\"post_date\" condition=\"is_less_than\" search=\"+30\" icon_class=\"fas fa-certificate\" badge=\"New\" bg_color=\"#ff0000\" txt_color=\"#ffffff\" alignment=\"left\"]\r\n\r\n[gd_post_badge key=\"featured\" condition=\"is_not_empty\" icon_class=\"fas fa-certificate\" badge=\"Featured\" bg_color=\"#ffb100\" txt_color=\"#ffffff\" alignment=\"left\"]\r\n\r\n[gd_post_badge key=\"claimed\" condition=\"is_not_empty\" search=\"+30\" icon_class=\"fas fa-user-check fa-fw\" badge=\"Verified\" bg_color=\"#23c526\" txt_color=\"#ffffff\" alignment=\"left\" list_hide_secondary=\"3\"]\r\n[gd_post_badge key=\"facebook\" condition=\"is_not_empty\" icon_class=\"fab fa-facebook-f fa-fw\" link=\"%%input%%\" new_window=\"1\" bg_color=\"#2b4be8\" txt_color=\"#ffffff\" alignment=\"left\"]\r\n[gd_post_badge key=\"twitter\" condition=\"is_not_empty\" icon_class=\"fab fa-twitter fa-fw\" link=\"%%input%%\" new_window=\"1\" bg_color=\"#2bb8e8\" txt_color=\"#ffffff\" alignment=\"left\"]\r\n[gd_post_badge key=\"website\" condition=\"is_not_empty\" icon_class=\"fas fa-link fa-fw\" link=\"%%input%%\" new_window=\"1\" bg_color=\"#85a9b5\" txt_color=\"#ffffff\" alignment=\"left\"]\r\n\r\n[gd_author_actions author_page_only='1']\r\n[gd_post_distance]\r\n[gd_post_rating alignment='left' list_hide_secondary='2']\r\n[gd_post_fav show='' alignment='right' list_hide_secondary='2']\r\n[gd_post_meta key='business_hours' location='listing' list_hide_secondary='2']\r\n[gd_output_location location='listing']\r\n[gd_post_content key='post_content' limit='60' max_height='120'][gd_archive_item_section type='close' position='right']\r\n<\/code><\/pre>\n<h3>Customizing<\/h3>\n<p>To use code snippets, see the doc about <a href=\"https:\/\/wpgeodirectory.com\/docs-v2\/faq\/customizing\/\">customizing<\/a>.<\/p>\n<h4>Archive item Per Price Package<\/h4>\n<p>If you want to hide some information on different layouts\/views, then <a href=\"https:\/\/wpgeodirectory.com\/docs-v2\/templates\/archive-item\/hiding-archive-item-components\/\">see this doc first<\/a>.<\/p>\n<p>If you have the Pricing Manager installed you can use the following code snippet to select different archive items templates for each price package.<\/p>\n<pre><code class='php'>\r\nfunction gd_snippet_010619_archive_item_page_id( $page_id, $post_type ) {\r\n\tglobal $gd_post;\r\n\t\r\n\tif ( ! empty( $gd_post ) &amp;&amp; ! empty( $gd_post-&gt;package_id ) ) {\r\n\t\t$package_id = $gd_post-&gt;package_id;\r\n\r\n\t\tif ( $package_id == 1 ) { \/\/ MATCH PACKAGE ID\r\n\t\t\t$page_id = 123; \/\/ ARCHIVE ITEM PAGE ID from PAGES\r\n\t\t} elseif ( $package_id == 2 ) {\r\n\t\t\t$page_id = 234;\r\n\t\t} elseif ( $package_id == 3 ) {\r\n\t\t\t$page_id = 567;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $page_id;\r\n}\r\nadd_filter( 'geodir_archive_item_page_id', 'gd_snippet_010619_archive_item_page_id', 10, 2 );\r\n<\/code><\/pre>\n<h3>Personalizing<\/h3>\n<h4><a href=\"#gd_author_actions\"name=\"gd_author_actions\">GD Author Actions<\/a><\/h4>\n<p>By default, V2 includes GD Author Actions in the Archive Item template. However the option for \u201cauthor page only\u201d is enabled to improve performance. If edit links load on every display then that is less efficient than loading them only on the author page.<\/p>\n<p>However, if you want to provide a list of listings for your listing owners to edit somewhere besides the author page, then that parameter must be disabled.<\/p>\n<p>To do so, edit the Archive Item template and switch out the GD Author Actions shortcode to remove that option so that the edit buttons etc are shown on every page, instead of just the author page.<\/p>\n","protected":false},"featured_media":0,"parent":683,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/712"}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/comments?post=712"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/712\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/683"}],"next":[{"title":"Archive Page Template","link":"https:\/\/wpgeodirectory.com\/docs-v2\/templates\/archive\/","href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/713"}],"prev":[{"title":"Map Bubble","link":"https:\/\/wpgeodirectory.com\/docs-v2\/templates\/map-bubble\/","href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/807"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/media?parent=712"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/doc_tag?post=712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}