There’s always something to howl about.

Real Estate Weblogging 101: Our story so far

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 posts that should be shoved into that mental drawer.

I did something like this when I created the Weblogging 101 category. I went back and added that category designation where it was appropriate.

Tonight I decided to go that one better, by highlighting the more important posts in that category in such a way that I could reference them repeatedly from other posts. You’ll see me do this from time to time, where we have multiple posts on one important topic. I’ll link back to all the others from each post so that no one misses anything.

There are two ways of doing this. One is manual coding, pasted in to the affected posts again and again. The other is to use PHP, the web-based programming language WordPress itself is written in. I can write my links into a separate file, then include that file when I want to reference the links. The advantage is that I have one canonical version of the links. Moreover, the list of links is dynamic; every time I edit the list, all the posts referencing that file of links are changed accordingly.

WordPress will run PHP unaided in many places on a weblog, and BloodhoundBlog runs on a lot of PHP. But within what WordPress calls “The Loop,” the software that displays weblog entries, running PHP requires a plug-in. I use the runPHP WordPress plug-in by James Van Lommel.

So, what happens? At the end of a post like this one, I append this code inside angle brackets:

?php include ("REWL101.php"); ?

The file named REWL101.php, my file full of links, is opened and inserted at that point. When I make a change in that file, the change is instantly reflected in every post that “includes” it. I can add my set of links to dozens of posts — even making them self-referencing, like this one — and update them all in bulk just by editing that one file.

Wanna see? Watch this…
< ?php include ("REWL101.php"); ?>

Technorati Tags: , ,