{"id":797,"date":"2019-05-20T12:30:36","date_gmt":"2019-05-20T12:30:36","guid":{"rendered":"https:\/\/wpgeodirectory.com\/docs-v2\/?post_type=docs&#038;p=797"},"modified":"2019-05-20T12:41:24","modified_gmt":"2019-05-20T12:41:24","slug":"hiding-archive-item-components","status":"publish","type":"docs","link":"https:\/\/wpgeodirectory.com\/docs-v2\/templates\/archive-item\/hiding-archive-item-components\/","title":{"rendered":"Hiding Archive Item components on grid views"},"content":{"rendered":"<h2>list_hide_secondary<\/h2>\n<p><em><strong>This option for some\u00a0widgets, blocks or shortcodes, allows you to create better looking pages when you show more than a few listings.<\/strong><\/em><\/p>\n<p>Adding\u00a0<em><strong>list_hide_secondary=&#8217;x&#8217;<\/strong><\/em> to a shortcode for a custom field will hide the secondary (less important) part of the display, where &#8216;x&#8217; refers to the type of view, for example &#8216;1&#8217; will hide the secondary part for <em><strong>List view and all Grid views<\/strong><\/em> and &#8216;4&#8217; will hide\u00a0the secondary part for <em><strong>Grid views<\/strong><\/em>\u00a0<em><strong>4 and 5<\/strong><\/em>.<\/p>\n<ol>\n<li>The Archive Item template is used to design how each listing looks like on your\u00a0\u00a0Listings and Search pages, and in <em><strong>GD &gt; Listings<\/strong><\/em> widgets, blocks or shortcodes.<\/li>\n<li>On Listings and Search pages, your visitors can select different views, like two listings in a row, or five listings in a row etc:<br \/>\n<img class=\"alignnone size-full wp-image-798\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide1.png\" alt=\"\" width=\"202\" height=\"244\" \/><\/li>\n<li>Here is an example of how <em><strong>List view<\/strong><\/em> looks if you are showing more than a few custom fields:<br \/>\n<img class=\"alignnone size-full wp-image-799\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide2.png\" alt=\"\" width=\"570\" height=\"105\" srcset=\"https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide2.png 570w, https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide2-300x55.png 300w\" sizes=\"(max-width: 570px) 100vw, 570px\" \/><\/li>\n<li>Part of the code (when using shortcodes) for this:\n<pre><code class='html'>[gd_post_rating alignment='left']\r\n[gd_post_fav show=\" alignment='right']<\/code><\/pre>\n<\/li>\n<li>If your visitor chooses <em><strong>Grid 5<\/strong><\/em>, then that same listing looks like this:<br \/>\n<img class=\"alignnone size-full wp-image-800\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide3.png\" alt=\"\" width=\"196\" height=\"209\" \/><\/li>\n<li>If we want to keep the same look for\u00a0<em><strong>List view<\/strong><\/em> but want to make the look of Grid 3, Grid 4 and Grid 5 a bit more compact, we can change the code like this:\n<pre><code class='html'>[gd_post_rating alignment='left' list_hide_secondary='3&#8242;]\r\n[gd_post_fav show=\" alignment='right' list_hide_secondary='3&#8242;]<\/code><\/pre>\n<\/li>\n<li>That code will hide the <em><strong>secondary<\/strong><\/em> part of the custom fields in Grid 3 and higher, like Grid 4 and Grid 5. The <em><strong>secondary<\/strong><\/em> part is the text after the icon:<br \/>\n<img class=\"alignnone size-full wp-image-801\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide4.png\" alt=\"\" width=\"499\" height=\"151\" srcset=\"https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide4.png 499w, https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide4-300x91.png 300w\" sizes=\"(max-width: 499px) 100vw, 499px\" \/><\/li>\n<\/ol>\n<h2>list_hide<\/h2>\n<p><em><strong>This option for some\u00a0widgets, blocks or shortcodes, allows you to hide the display of custom fields for selected Grid Views.<\/strong><\/em><\/p>\n<p>Adding\u00a0<em><strong>list_hide=&#8217;x&#8217;<\/strong><\/em> to a shortcode for a custom field will hide the custom field, where &#8216;x&#8217; refers to the type of view, for example &#8216;1&#8217; will hide the custom field for <em><strong>List view and all Grid views<\/strong><\/em> and &#8216;5&#8217; will hide\u00a0the custom field for <em><strong>Grid View<\/strong><\/em><em><strong>\u00a05<\/strong><\/em>.<\/p>\n<ol>\n<li>For example, this code will hide the reviews stars and text from\u00a0<em><strong>Grid View 3, Grid View 4 and Grid View 5<\/strong><\/em>:\n<pre><code class='html'>[gd_post_rating alignment='left' list_hide='3&#8242;]<\/code><\/pre>\n<\/li>\n<li><em><strong>List View<\/strong><\/em>:<br \/>\n<img class=\"alignnone size-full wp-image-799\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide2.png\" alt=\"\" width=\"570\" height=\"105\" srcset=\"https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide2.png 570w, https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide2-300x55.png 300w\" sizes=\"(max-width: 570px) 100vw, 570px\" \/><\/li>\n<li><em><strong>Grid View 4<\/strong><\/em>:<br \/>\n<img class=\"alignnone size-full wp-image-802\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide5.png\" alt=\"\" width=\"494\" height=\"116\" srcset=\"https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide5.png 494w, https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/05\/hide5-300x70.png 300w\" sizes=\"(max-width: 494px) 100vw, 494px\" \/><\/li>\n<\/ol>\n","protected":false},"featured_media":0,"parent":712,"menu_order":0,"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\/797"}],"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=797"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/797\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/712"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/media?parent=797"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/doc_tag?post=797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}