{"id":22588,"date":"2016-07-23T22:58:41","date_gmt":"2016-07-23T22:58:41","guid":{"rendered":"https:\/\/wpgeodirectory.com\/docs\/?p=22588"},"modified":"2018-01-31T22:05:09","modified_gmt":"2018-01-31T22:05:09","slug":"gd-core-plugin-titles-metas","status":"publish","type":"post","link":"https:\/\/wpgeodirectory.com\/docs\/gd-core-plugin-titles-metas\/","title":{"rendered":"GD Core Plugin &#8211; Titles &#038; Metas"},"content":{"rendered":"<h4>These are the sections\u00a0you will find when you install the GeoDirectory Core (free) plugin only:<\/h4>\n<p><a href=\"\/docs\/core-overview\/\">Overview<\/a> &#8211; <a href=\"https:\/\/wpgeodirectory.com\/docs\/core-general\/\">General<\/a>\u00a0&#8211; <a href=\"\/docs\/gd-core-plugin-google-analytics\/\">Google Analytics<\/a> &#8211; <a href=\"\/docs\/core-design\/\">Design<\/a> &#8211; <a href=\"\/docs\/core-permalinks\">Permalinks<\/a>\u00a0&#8211; <strong>Titles &amp; Metas<\/strong>\u00a0&#8211; <a href=\"\/docs\/core-notifications\/\">Notifications<\/a> &#8211; <a href=\"\/docs\/core-location\/\">Set Default Location<\/a> &#8211; <a href=\"\/docs\/core-place-settings\/\">Place Settings<\/a> &#8211;\u00a0<a href=\"\/docs\/core-theme\/\">Theme Compatibility<\/a> &#8211;\u00a0<a href=\"\/docs\/core-export\/\">Import &amp; Export<\/a> &#8211; <a href=\"\/docs\/core-tools\/\">GD Tools<\/a><\/p>\n<h4>On this page:<\/h4>\n<p><a href=\"#intro\">Introduction<\/a>\u00a0&#8211; <a href=\"#variables\">Available variables<\/a>\u00a0&#8211; <a href=\"#titles\">Using title &amp; meta variables in widget titles<\/a><\/p>\n<h3><a id=\"intro\"><\/a>Introduction<\/h3>\n<ol>\n<li>This image shows where to find the\u00a0<em><strong>Titles &amp; Metas<\/strong><\/em> settings:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/07\/meta1.png\" alt=\"\" width=\"580\" height=\"133\" \/><\/li>\n<li>These settings allow you to change the <em><strong>meta title<\/strong><\/em><br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/07\/meta2.png\" alt=\"\" width=\"609\" height=\"69\" \/><br \/>\nand the <em><strong>meta description <\/strong><\/em>(Meta descriptions are commonly used on search engine result pages (SERPs) to display preview snippets for a webpage):<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/07\/meta3.png\" alt=\"\" width=\"395\" height=\"105\" \/><\/li>\n<li><i class=\"fa fa-exclamation-triangle fa-2x\" style=\"color: red;\"><\/i> If you use the\u00a0Yoast SEO plugin, the settings added to\u00a0<em><strong>GD &gt; Titles &amp; Metas<\/strong><\/em> will not work, you will need to use the settings of the Yoast SEO plugin.<\/li>\n<\/ol>\n<h3><a id=\"variables\"><\/a>Available variables<\/h3>\n<p>All meta titles and meta descriptions can use the following variables:<\/p>\n<table>\n<tbody>\n<tr>\n<td>%%title%%<\/td>\n<td>Title of a listing.<br \/>\n<i class=\"fa fa-lightbulb-o fa-2x\" style=\"color: green;\"><\/i> Do <em><strong>not<\/strong><\/em> use for listings pages.<\/td>\n<\/tr>\n<tr>\n<td>%%sitename%%<\/td>\n<td>Your site name as entered at <em><strong>WP Settings &gt; General Settings &gt; Site Title.<\/strong><\/em><\/td>\n<\/tr>\n<tr>\n<td>%%sitedesc%%<\/td>\n<td>Your site description\u00a0as entered at <em><strong>WP Settings &gt; General Settings &gt; Tagline.<\/strong><\/em><\/td>\n<\/tr>\n<tr>\n<td>%%excerpt%%<\/td>\n<td>This refers to the WP excerpt you can add to listings, posts and pages.<\/td>\n<\/tr>\n<tr>\n<td>%%pt_single%%<\/td>\n<td>The singular form of a Custom Post Type, for example <strong>Place<\/strong> or <strong>Event<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td>%%pt_plural%%<\/td>\n<td>The plural\u00a0form of a Custom Post Type, for example <strong>Places<\/strong> or <strong>Events<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td>%%category%%<\/td>\n<td>Indeed, the category.<\/td>\n<\/tr>\n<tr>\n<td>%%id%%<\/td>\n<td>The ID of the page or listing.<\/td>\n<\/tr>\n<tr>\n<td>%%sep%%<\/td>\n<td>Separator between parts.<\/td>\n<\/tr>\n<tr>\n<td>%%location%%<\/td>\n<td>Location in this format: <em><strong>city, region, country<\/strong><\/em>.<\/td>\n<\/tr>\n<tr>\n<td>%%in_location%%<\/td>\n<td>Location with a prefix of your choice in this format:<em><strong> in\u00a0<\/strong><strong>city, region, country<\/strong><\/em>.<br \/>\n<a href=\"https:\/\/wpgeodirectory.com\/docs\/translate-core\/\"><i class=\"fa fa-lightbulb-o fa-2x\" style=\"color: green;\"><\/i> You can translate <em><strong>in<\/strong><\/em> in the core language file.<\/a><\/td>\n<\/tr>\n<tr>\n<td>%%location_single%%<\/td>\n<td>Location\u00a0referring to the location of the page itself, for example <em><strong>Madrid<\/strong><\/em>, or <em><strong>Japan<\/strong><\/em>.<\/td>\n<\/tr>\n<tr>\n<td>%%in_location_single%%<\/td>\n<td>Location\u00a0referring to the location of the page itself, with a prefix of your choice, for example <em><strong>in Los Angeles<\/strong><\/em>, or <em><strong>in Argentina<\/strong><\/em>.<br \/>\n<a href=\"https:\/\/wpgeodirectory.com\/docs\/translate-core\/\"><i class=\"fa fa-lightbulb-o fa-2x\" style=\"color: green;\"><\/i> You can translate <em><strong>in<\/strong><\/em> in the core language file.<\/a><\/td>\n<\/tr>\n<tr>\n<td>%%search_term%%<\/td>\n<td>Whatever was entered as a search term (for search pages only).<\/td>\n<\/tr>\n<tr>\n<td>%%search_near%%<\/td>\n<td>Location entered in the <em><strong>Near<\/strong><\/em> field of the GD Search\u00a0(for search pages only).<\/td>\n<\/tr>\n<tr>\n<td>%%name%%<\/td>\n<td>Name of the user (for author pages only).<\/td>\n<\/tr>\n<tr>\n<td>%%page%%<\/td>\n<td>Title of a WP page.<\/td>\n<\/tr>\n<tr>\n<td>%%pagenumber%%<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>%%pagetotal%%<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><a id=\"titles\"><\/a>Using title &amp; meta variables in widget titles<\/h3>\n<ol>\n<li>To enable the use the above variables in the titles of GD widgets, add this code to your child theme&#8217;s functions.php file, or use the <a href=\"https:\/\/wpgeodirectory.com\/docs\/useful-plugins\/#snippets\">Code Snippets plugin<\/a>:\n<p>[php]\/\/ Use title and meta variables in widget titles.<br \/>\nfunction gd_widget_title( $title ) {<br \/>\n    if ( !empty( $title ) ) {<br \/>\n        $title = geodir_filter_title_variables( $title, &#8216;location&#8217;, &#8221; );<br \/>\n    }<\/p>\n<p>    return $title;<br \/>\n}<br \/>\nadd_filter( &#8216;widget_title&#8217;, &#8216;gd_widget_title&#8217;, 10, 1 );<br \/>\nadd_filter( &#8216;bestof_widget_title&#8217;, &#8216;gd_widget_title&#8217;, 10, 1 );<br \/>\nadd_filter( &#8216;gd_features_widget_title&#8217;, &#8216;gd_widget_title&#8217;, 10, 1 );<br \/>\nadd_filter( &#8216;geodir_cpt_categories_widget_title&#8217;, &#8216;gd_widget_title&#8217;, 10, 1 );<br \/>\nadd_filter( &#8216;geodir_popular_location_widget_title&#8217;, &#8216;gd_widget_title&#8217;, 10, 1 );<br \/>\nadd_filter( &#8216;geodir_location_description_widget_title&#8217;, &#8216;gd_widget_title&#8217;, 10, 1 );<br \/>\nadd_filter( &#8216;geodir_location_neighbourhood_widget_title&#8217;, &#8216;gd_widget_title&#8217;, 10, 1 );[\/php]<\/p>\n<\/li>\n<li>You can now\u00a0add as a title to one of the\u00a0above widgets, for example:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/07\/useful3.png\" alt=\"\" width=\"303\" height=\"224\" \/><\/li>\n<li>And this would be the result for one of the location pages:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2016\/07\/useful4.png\" alt=\"\" width=\"400\" height=\"188\" \/><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>These are the sections\u00a0you will find when you install the GeoDirectory Core (free) plugin only: Overview &#8211; General\u00a0&#8211; Google Analytics &#8211; Design &#8211; Permalinks\u00a0&#8211; Titles &amp; Metas\u00a0&#8211; Notifications &#8211; Set Default Location &#8211; Place Settings &#8211;\u00a0Theme Compatibility &#8211;\u00a0Import &amp; Export &#8211; GD Tools On this page: Introduction\u00a0&#8211; Available variables\u00a0&#8211; Using title &amp; meta variables in &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/wpgeodirectory.com\/docs\/gd-core-plugin-titles-metas\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;GD Core Plugin &#8211; Titles &#038; Metas&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1676,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/22588"}],"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=22588"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/22588\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/media?parent=22588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/categories?post=22588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/tags?post=22588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}