{"id":950,"date":"2019-11-19T00:27:32","date_gmt":"2019-11-19T00:27:32","guid":{"rendered":"https:\/\/wpgeodirectory.com\/docs-v2\/?post_type=docs&#038;p=950"},"modified":"2020-02-20T19:10:36","modified_gmt":"2020-02-20T19:10:36","slug":"gd-badge","status":"publish","type":"docs","link":"https:\/\/wpgeodirectory.com\/docs-v2\/design\/gd-badge\/","title":{"rendered":"GD > Badge"},"content":{"rendered":"<p><span class=\"bookmark-index\"><br \/>\n<a href=\"#intro\">Introduction<\/a><br \/>\n<a href=\"#settings\">Settings<\/a><br \/>\n<a href=\"#examples\">Examples<\/a><br \/>\n<a href=\"#faq\">Frequently Asked Questions<\/a><br \/>\n<\/span><\/p>\n<h3><a href=\"#intro\" id=\"intro\">Introduction<\/a><\/h3>\n<p>GD > Post Badge is a versatile and powerful element that you can use to display custom content based on the values of custom fields in the listing.<\/p>\n<h3><a href=\"#settings\" id=\"settings\">Settings<\/a><\/h3>\n<p>Use a Block, Widget, or Shortcode to place a badge.<\/p>\n<p>Below are the settings available for any version. You can find this form in the <a href=\"https:\/\/wpgeodirectory.com\/docs-v2\/geodirectory\/shortcode-builder\/\">shortcode builder<\/a>.<\/p>\n<p><a href=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/11\/badge.jpg\"><img src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/11\/badge.jpg\" alt=\"\" width=\"755\" height=\"720\" class=\"alignnone size-full wp-image-952\" srcset=\"https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/11\/badge.jpg 755w, https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2019\/11\/badge-300x286.jpg 300w\" sizes=\"(max-width: 755px) 100vw, 755px\" \/><\/a><\/p>\n<h3><a href=\"#examples\" id=\"examples\">Examples<\/a><\/h3>\n<blockquote class=\"gd-faq\">\n<p>GD Post Badge is a powerful tool for adding highlights or targeted interactive elements to your listings. You can use badges in the archive item or on the detail page.<\/p>\n<p><strong><a href=\"#read-more\" name=\"read-more\">Example &#8211; Read More link in the Archive item<\/a><\/strong><\/p>\n<p>Use the following configuration to add a &#8220;Read More&#8221; link to your archive item template:<\/p>\n<pre><code>\r\n[gd_post_badge key=\"post_title\" condition=\"is_not_empty\" badge=\"Read More\" link=\"%%post_url%%\" bg_color=\"#ffffff\" txt_color=\"#433aed\" alignment=\"center\"]\r\n<\/code><\/pre>\n<p><strong>Example &#8211; Custom Website Link<\/strong><\/p>\n<pre><code>\r\n\r\n[gd_post_badge key=\"website\" condition=\"is_not_empty\" badge=\"Awesome Super Link\" link=\"%%input%%\" bg_color=\"#9c03aa\" txt_color=\"#ffffff\" size=\"extra-large\" list_hide=\"3\" list_hide_secondary=\"2\"]\r\n\r\n<\/code><\/pre>\n<p><strong>Example &#8211; Claim Listings<\/strong><br \/>\n<a href=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/gd-badges-claimed.jpg\"><img class=\"alignnone size-full wp-image-546\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/gd-badges-claimed.jpg\" alt=\"\" width=\"125\" height=\"56\" \/><\/a><\/p>\n<pre><code class='css'>\r\n\r\n[gd_post_badge key=&quot;claimed&quot; condition=&quot;is_not_empty&quot; badge='&lt;i class=&quot;fas fa-check-circle&quot;&gt;&lt;\/i&gt;Verified' bg_color=&quot;#ff8040&quot; txt_color=&quot;#ffffff&quot; size=&quot;small&quot; alignment=&quot;right&quot; css_class=&quot;verified&quot;]\r\n\r\n<\/code><\/pre>\n<p><a href=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/gd-badges-unclaimed-2.jpg\"><img class=\"alignnone size-full wp-image-548\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/gd-badges-unclaimed-2.jpg\" alt=\"\" width=\"143\" height=\"47\" \/><\/a><\/p>\n<pre><code class='css'>\r\n\r\n[gd_post_badge key=&quot;claimed&quot; condition=&quot;is_empty&quot; badge='&lt;i class=&quot;far fa-question-circle&quot;&gt;&lt;\/i&gt;Unclaimed' bg_color=&quot;#ff8040&quot; txt_color=&quot;#ffffff&quot; size=&quot;small&quot; alignment=&quot;right&quot; css_class=&quot;unverified&quot;]\r\n\r\n<\/code><\/pre>\n<p><strong>Example &#8211; Visit my website<\/strong><br \/>\n<a href=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/my-website.jpg\"><img class=\"alignnone size-full wp-image-637\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/my-website.jpg\" alt=\"\" width=\"246\" height=\"48\" \/><\/a><\/p>\n<pre><code class='css'>\r\n\r\n[gd_post_badge key=&quot;website&quot; condition=&quot;is_not_empty&quot;  badge='Visit my &lt;a href=&quot;%%input%%&quot;&gt;&lt;i class=&quot;fas fa-music&quot;&gt;&lt;\/i&gt; website&lt;\/a&gt;' bg_color=&quot;#800080&quot; txt_color=&quot;#ffffff&quot;]\r\n\r\n<\/code><\/pre>\n<p><strong><a href=\"#featured-badge\" name=\"featured-badge\">Example &#8211; Featured Listings<\/a><\/strong><\/p>\n<p>See an <a href=\"https:\/\/wpgeodirectory.com\/docs-v2\/geodirectory\/featured-listings\/\">example here<\/a> for use with featured listings.<br \/>\n<a href=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/badges.jpg\"><img class=\"alignnone size-full wp-image-707\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/badges.jpg\" alt=\"\" width=\"150\" srcset=\"https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/badges.jpg 390w, https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/badges-300x72.jpg 300w\" sizes=\"(max-width: 390px) 100vw, 390px\" \/><\/a><\/p>\n<p><strong><a href=\"#badge-classes\" name=\"badge-classes\">Example &#8211; Badge Classes<\/a><\/strong><\/p>\n<p>These custom classes can be added to your badge to change the way it is displayed within the containing div.<\/p>\n<p>To use these over the top of an archive item GD Post Images, be sure to include the badge before the GD Archive Item Close element.<\/p>\n<pre><code class='css'>\r\ngd-badge-shadow \/\/ adds a shadow to the badge\r\ngd-ab-top-left \/\/ positions absolute top, absolute left\r\ngd-ab-top-left-angle \/\/ positions absolute top, absolute left, at an angle\r\ngd-ab-top-right \/\/ positions absolute top, absolute right\r\ngd-ab-top-right-angle \/\/ positions absolute top, absolute right, at an angle\r\ngd-ab-bottom-left \/\/ positions absolute bottom, absolute left\r\ngd-ab-bottom-left-angle \/\/ positions absolute bottom, absolute left, at an angle\r\ngd-ab-bottom-right \/\/ positions absolute bottom, absolute right\r\ngd-ab-bottom-right-angle \/\/ positions absolute bottom, absolute right, at an angle\r\ngd-lity  \/\/ adds interactivity &#8211; launching a video link in a lightbox, for example\r\n<\/code><\/pre>\n<p><a href=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/Screenshot-from-2019-04-05-13-06-14.png\"><img class=\"alignnone size-full wp-image-708\" src=\"http:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/Screenshot-from-2019-04-05-13-06-14.png\" alt=\"\" width=\"300\" srcset=\"https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/Screenshot-from-2019-04-05-13-06-14.png 384w, https:\/\/wpgeodirectory.com\/docs-v2\/wp-content\/uploads\/sites\/23\/2018\/05\/Screenshot-from-2019-04-05-13-06-14-300x195.png 300w\" sizes=\"(max-width: 384px) 100vw, 384px\" \/><\/a><\/p>\n<p>Taxonomy Badges<\/p>\n<pre><code>[gd_post_badge key=\"post_category\" condition=\"is_contains\" search=\"32\" badge=\"Attractions\" bg_color=\"#0073aa\" txt_color=\"#ffffff\"]\r\n[gd_post_badge key=\"post_category\" condition=\"is_contains\" search=\"32,33\" badge=\"Attractions \/ Hotels\" bg_color=\"#0073aa\" txt_color=\"#ffffff\"]\r\n[gd_post_badge key=\"post_tags\" condition=\"is_contains\" search=\"Museum\" badge=\"Museum\" bg_color=\"#0073aa\" txt_color=\"#ffffff\"]\r\n[gd_post_badge key=\"post_tags\" condition=\"is_contains\" search=\"Museum,Garden\" badge=\"Museum \/ Garden\" bg_color=\"#0073aa\" txt_color=\"#ffffff\"]<\/code><\/pre>\n<p><strong><a href=\"#image\" name=\"image\">Example &#8211; HTML Image Badge<\/a><\/strong><\/p>\n<p>HTML can be used in the badge param. Make sure to enclose the HTML with &#8221; (quotes&#8221; and then use &#8216; (apostrophe) for inner HTML. <\/p>\n<pre><code class='html'>\r\n[gd_post_badge key=\"my_custom_field\" condition=\"is_not_empty\" badge=\"&lt;img src='https:\/\/mysite.com\/wp-content\/uploads\/2020\/02\/pbjt.jpg'\/&gt;\" bg_color=\"#ffffff\" txt_color=\"#ffffff\"]\r\n<\/code><\/pre>\n<\/blockquote>\n<h4>Using &#8216;post_modified&#8217; to show the date of last update or &#8220;Recently Updated&#8221;<\/h4>\n<blockquote class=\"gd-faq\">\n<p>post_modified is the date that a listing was most recently updated.<\/p>\n<p>If you create a badge and use %%input%% for the badge, post_modified will show as a date.<\/p>\n<p>To show &#8220;Recently Updated!&#8221; if a post was updated in the last 30 days use:<\/p>\n<pre><code class='php'>\r\n[gd_post_badge key='post_modified' condition='is_less_than' search='+30&#8242; icon_class='fas fa-certificate' badge='Recently Updated!' bg_color='#ff0000&#8242; txt_color='#ffffff' alignment='left']\r\n<\/code><\/pre>\n<\/blockquote>\n","protected":false},"featured_media":0,"parent":806,"menu_order":0,"comment_status":"open","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\/950"}],"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=950"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/950\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/806"}],"next":[{"title":"GD > Listings","link":"https:\/\/wpgeodirectory.com\/docs-v2\/design\/gd-listings\/","href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/651"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/media?parent=950"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/doc_tag?post=950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}