{"id":1410568,"date":"2010-03-03T19:56:19","date_gmt":"2010-03-03T19:56:19","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/add-title-to-a-echoed-url\/"},"modified":"2016-08-19T16:10:09","modified_gmt":"2016-08-19T16:10:09","slug":"add-title-to-a-echoed-url","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/add-title-to-a-echoed-url\/","title":{"rendered":"Add title to a echoed URL"},"content":{"rendered":"<p>This code gets one url and one text from my custom fields and combines it to a link:<\/p>\n<pre><code>&lt;?php\n$link = get_post_meta($post-&gt;ID, &#039;link_url&#039;, true);\n$text = get_post_meta($post-&gt;ID, &#039;link_text&#039;, true);\n if ($link){\necho &#039;&amp;nbsp;&amp;middot; &lt;a href=&quot;&#039;.$link .&#039;&quot;&gt;&#039;.$text.&#039;&lt;\/a&gt;&amp;nbsp;&#039;;\n}\n?&gt;<\/code><\/pre>\n<p>I would like to add a title=&#8221;description of link&#8221;, but this is not possible through custom fields. I tried adding it as a variable in the template, but it was only the variable name itself which was echoed&#8230;<\/p>\n","protected":false},"template":"","class_list":["post-1410568","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1410568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1410568\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1410568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}