{"id":37,"date":"2005-03-16T20:59:34","date_gmt":"2005-03-17T00:59:34","guid":{"rendered":"http:\/\/hoogervorst.dyndns.org\/~arthur\/wordpress\/?p=37"},"modified":"2005-03-16T21:02:10","modified_gmt":"2005-03-17T01:02:10","slug":"linkthroughs-ii","status":"publish","type":"post","link":"http:\/\/www.hoogervorst.ca\/arthur\/?p=37","title":{"rendered":"LinkThroughs II"},"content":{"rendered":"<p><span class=\"dropcap\">A<\/span> couple of minor changes to the &#8216;Related Links&#8217; portions that appear in the individual posts. There&#8217;s no need to show the &#8216;Related Links&#8217; portion when there are no external links. This is what the code looks like right now (in the file <em>single.php<\/em>):\n<\/p>\n<p><code><br \/>\n&lt;div id=\"sidebar\"><br \/>\n&lt;?php $stage =  get_post_meta($id, '*YOURCUSTOMFIELDNAME*', TRUE);<br \/>\n      if (!empty($stage)) { ?><br \/>\n    &lt;ul>&lt;li><br \/>\n    &lt;h2>LinkThroughs&lt;\/h2><br \/>\n    &lt;ul><br \/>\n    &lt;?php $arrays = explode(\"\\n\", $stage);<br \/>\n           foreach ($arrays as $value) {<br \/>\n           echo '&lt;li class=\"postmetadata alt\">' . $value . '&lt;\/li>'; } ?><br \/>\n    &lt;\/ul><br \/>\n    &lt;\/li><br \/>\n    &lt;\/ul><br \/>\n &lt;p class=\"postmetadata alt\">The<br \/>\n author of this site is not responsible for<br \/>\n the content of external internet sites &lt;\/p><br \/>\n &lt;?php } ?><br \/>\n&lt;\/div><br \/>\n<\/code><\/p>\n<p>Make sure to name your custom field name and to change it in the code above. Also note that I use the newline character as the divider and that the $id is a global variable too! That text area box in the post.php is a bit small. Another part: I added a new &#8216;div&#8217; box (class of sidebar) to the single.php file, because my template can handle that extra box. If you do not use a Kubrick-like theme, play around with floating boxes (careful: IE may not really like it, while Firefox and Opera will take those).\n<\/p>\n<p>Next up, actually integrate this into a plugin or in the post.php page itself.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of minor changes to the &#8216;Related Links&#8217; portions that appear in the individual posts. There&#8217;s no need to show the &#8216;Related Links&#8217; portion when there are no external links. This is what the code looks like right now &hellip; <a href=\"http:\/\/www.hoogervorst.ca\/arthur\/?p=37\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[],"_links":{"self":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/37"}],"collection":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=37"}],"version-history":[{"count":0,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}