{"id":1301,"date":"2007-04-13T15:12:28","date_gmt":"2007-04-13T22:12:28","guid":{"rendered":"http:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/?p=1301"},"modified":"2007-04-13T15:25:43","modified_gmt":"2007-04-13T22:25:43","slug":"customizing-your-weblog-with-css-and-php-navigating-from-post-to-post","status":"publish","type":"post","link":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/1301\/customizing-your-weblog-with-css-and-php-navigating-from-post-to-post\/","title":{"rendered":"Customizing your weblog with CSS and PHP: Navigating from post to post"},"content":{"rendered":"<p>If you click on an individual post in BloodhoundBlog, you&#8217;ll see something like this above the headline:<\/p>\n<p align=\"center\"><img decoding=\"async\" border=\"1\" src=\"http:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/PostControl.png\"\/><\/p>\n<p>The code for doing this is built into some themes, but not in the theme we&#8217;re using. The PHP code for making it happen is actually pretty simple, you just have to plug it in in the right place. And all of this presumes you are working on a WordPress.org weblog on a host you can access by FTP. I know nothing about WordPress.com-hosted weblogs or other weblogging systems.<\/p>\n<p>Where is the right place to insert the code? In the folder for the theme you are using (inside the wp-content\/themes folder), you <i>may<\/i> find a file named &#8220;single.php&#8221;. If so, that&#8217;s the file you want to edit. If &#8220;single.php&#8221; is not there, you want to edit &#8220;index.php&#8221;.<\/p>\n<p>Before you change anything, save a back-up copy of the file you are going to edit. That way, you can back out and try again if things don&#8217;t work out.<\/p>\n<p>You are looking for this line of code:<\/p>\n<pre>&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;<\/pre>\n<p>Immediately <i>after<\/i> that line, paste in this code:<\/p>\n<pre>&lt;div class=\"navigation\"&gt;\r\n&lt;div align=\"center\"&gt;&lt;?php previous_post_link('&amp;laquo; %link') ?&gt;&lt;\/div&gt;\r\n&lt;div align=\"center\"&gt;&lt;?php next_post_link('%link &amp;raquo;') ?&gt;&lt;\/div&gt;&lt;br&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>Once you have edited the file, FTP it back up to the host and see what happens. If it worked, you should be able to navigate your weblog post-by-post. If it didn&#8217;t, go back and try to figure out what went wrong.<\/p>\n<p>I&#8217;m going to do some more of this stuff over the weekend, but not too much. The truth is, if your mind runs this way, you&#8217;re probably better at it than I am. And if not, your eyes are already glazed over. If you&#8217;re somewhere in the middle, a little bit of simple PHP can give you a whole lot of custom control over your weblog&#8217;s behavior. To that extent, it&#8217;s worth talking about.<\/p>\n<p><!-- technorati tags start --><\/p>\n<p style=\"text-align:right;font-size:10px;\">Technorati Tags: <a href=\"http:\/\/www.technorati.com\/tag\/blogging\" rel=\"tag\">blogging<\/a>, <a href=\"http:\/\/www.technorati.com\/tag\/real estate\" rel=\"tag\">real estate<\/a>, <a href=\"http:\/\/www.technorati.com\/tag\/real estate marketing\" rel=\"tag\">real estate marketing<\/a><\/p>\n<p><!-- technorati tags end --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you click on an individual post in BloodhoundBlog, you&#8217;ll see something like this above the headline: The code for doing this is built into some themes, but not in the theme we&#8217;re using. The PHP code for making it happen is actually pretty simple, you just have to plug it in in the right [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[3,6,5,19,16],"tags":[],"class_list":{"0":"post-1301","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-blogging","7":"category-marketing","8":"category-real-estate","9":"category-technology","10":"category-weblogging-101","12":"no-featured-image"},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1224,"url":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/1224\/how-to-make-google-your-weblogs-best-friend\/","url_meta":{"origin":1301,"position":0},"title":"Project Bloodhound: How to make Google your weblog&#8217;s best friend","author":"Greg Swann","date":"June 27, 2008","format":false,"excerpt":"[This is one of the all-time most popular posts on BloodhoundBlog. I'm reprising it for Project Bloodhound, first because it's a nice leveraged SEO solution, and second because it's a painless introduction to customizing the PHP in WordPress. --GSS] \u00a0Who can probe all the mysteries of Google? Not me, and\u2026","rel":"","context":"In &quot;Blogging&quot;","block_context":{"text":"Blogging","link":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/category\/blogging\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1298,"url":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/1298\/real-estate-weblogging-101-our-story-so-far\/","url_meta":{"origin":1301,"position":1},"title":"Real Estate Weblogging 101: Our story so far","author":"Greg Swann","date":"April 13, 2007","format":false,"excerpt":"Here's a true fact of weblogging: Sometimes you decide you want to do something that requires you to go back and edit 30 or 40 posts. As an example, imagine that you decided you wanted to add a new category. You would have to go back and re-categorize all the\u2026","rel":"","context":"In &quot;Blogging&quot;","block_context":{"text":"Blogging","link":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/category\/blogging\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1303,"url":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/1303\/better-faster-and-cheaper-in-time-and-effort-software-for-managing-the-weblogging-workflow\/","url_meta":{"origin":1301,"position":2},"title":"Better, faster and cheaper in time and effort: Software for managing the weblogging workflow","author":"Greg Swann","date":"April 15, 2007","format":false,"excerpt":"Robbie Paplin has a new weblog and he writes there and at Rain City Guide about the Deep Geek thinking underlying his decision-making process in selecting his new blogging platform. Very interesting reading. I spent my junk time yesterday doing fussy CSS tweaks on Teri Lussier's weblog, TheBrickRanch.com. This is\u2026","rel":"","context":"In &quot;Blogging&quot;","block_context":{"text":"Blogging","link":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/category\/blogging\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2533,"url":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/2533\/speaking-in-tongues-a-universal-contact-form-for-real-estate-weblogs\/","url_meta":{"origin":1301,"position":3},"title":"Speaking in tongues: A universal contact form for real estate weblogs&#8230;","author":"Greg Swann","date":"January 23, 2008","format":false,"excerpt":"Nota bene: Slightly amended. Reread carefully. I landed on Jeff Kempe's weblog yesterday. In the way of the web, I don't remember how I got there or why I came. But I spent a little while looking around, without quite realizing what I was looking for. And then it hit\u2026","rel":"","context":"In &quot;Blogging&quot;","block_context":{"text":"Blogging","link":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/category\/blogging\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2471,"url":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/2471\/announcing-the-odysseus-medal-long-list-of-nominees-widget\/","url_meta":{"origin":1301,"position":4},"title":"Announcing the Odysseus Medal Long List of nominees widget","author":"Greg Swann","date":"January 5, 2008","format":false,"excerpt":"I'm usually not awake when I post at this hour, but I am today. I built a new widget last night that will link to each new Odysseus Medal nominee as it comes in. This is something I've been planning to do for a while, but I took care of\u2026","rel":"","context":"In &quot;Blog Carnivals&quot;","block_context":{"text":"Blog Carnivals","link":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/category\/blog-carnivals\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3305,"url":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/3305\/project-bloodhound-speaking-in-tongues-to-whom-am-i-speaking\/","url_meta":{"origin":1301,"position":5},"title":"Project Bloodhound speaking in tongues: To whom am I speaking?","author":"Greg Swann","date":"June 30, 2008","format":false,"excerpt":"I had a lady phone me the other day who would rather have emailed. She was on our Phoenix real estate web site and she couldn't figure out how to email me. In fact, my email address is associated with every post, just like here, but that wasn't obvious to\u2026","rel":"","context":"In &quot;Blogging&quot;","block_context":{"text":"Blogging","link":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/category\/blogging\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/wp-json\/wp\/v2\/posts\/1301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/wp-json\/wp\/v2\/comments?post=1301"}],"version-history":[{"count":0,"href":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/wp-json\/wp\/v2\/posts\/1301\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/wp-json\/wp\/v2\/media?parent=1301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/wp-json\/wp\/v2\/categories?post=1301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bloodhoundrealty.com\/BloodhoundBlog\/wp-json\/wp\/v2\/tags?post=1301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}