Related and Random Posts.

One of my biggest issues with blogging is that the posts that you write are really only seen for a week or two, then they fade into obscurity. Sure, some of the content is found by people through search engines, but for the most part they are only seen if someone goes looking for them. I don’t see many people read any further than the front page, which is about 10 posts.

That’s why I kinda like this WordPress plugin I ran across. It brings up some of those old posts back as either random posts at the end of a current post, or as a list of posts that are considered to be of related content.

We’ll see how well it works, but for anyone else interested in it, here are the details.

The plugin is: WordPress 2.3 Related Posts
Download it from WordPress.org
Or you can visit the site of the guy that wrote it: Fairyfish.net
Click here for the direct download from WordPress.

Here are the installation instructions:
1. Upload the WP23RP folder to the /wp-content/plugins/ directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Place <?php wp23_related_posts(); ?> in your templates
4. Navigate to Manage Panel > Option > WP23 Related Posts to configure plugin output.

I installed mine onto my K2 theme, so I had to insert the <?php wp23_related_posts(); ?> into the file named “theloop.php” located in the K2 directory under the themes directory. I inserted the code onto line 140 just after this line:
<?php the_content(sprintf(__(‘Continue reading \’%s\”, ‘k2_domain’), the_title(”, ”, false))); ?>

After that, just login to your control panel and play with the WP23 Related Posts option under the options tab.

K2 Theme for WordPress.

I love the new K2 Theme for WordPress.

I have one major annoyance though. The “pages” that you create in wordpress automatically appear as tabs in the header of the website. I REALLY don’t want them there but there is no way to remove them through the admin interface. I’ve searched around quite a bit and the only solution I’ve found to the problem is to edit the PHP code. I found the offensive code and edited it so the “pages” no longer appear as tabs at the top of my website.

Here is the fix I used to knock out the “pages” from the header.

I am running the “K2 Release Candidate 4″ version.

1. Find the header.php file. It should be located in this directory:
“wp-content/themes/k2″

2. Towards the bottom of the file you should find this line of code:
<?php wp_list_pages(‘sort_column=menu_order&depth=1&title_li=’); ?>

I have a completely UNMODIFIED version of the theme. This is my first modification. In my header.php file it is on line #137

3. To completely remove the pages from the header all you have to do is comment out the php line by adding two “//” characters right after the beginning of opening php tag. The completed line will look like this:
<?php //wp_list_pages(‘sort_column=menu_order&depth=1&title_li=’); ?>
^^ see the change! :-)

4. I could have just deleted the entire line but I always like to leave the original code in case I ever need to refer back to it later.

5. Congratulations! You just deleted your “pages” from the header of your site!

Now, you may still want to display your pages somewhere on your site, I did! Here’s what I did so I could still view my pages as a sidebar module.

1. Log into your wordpress admin account and goto the “K2 Sidebar Manager” under the Presentation tab.

2. Add a new module to one of your sidebars using the “Text, HTML, and PHP” module.

3. Add this code to the module:

<ul>
<li>
<?php wp_list_pages(‘title_li=’ ); ?>
</li>
</ul>

4. Viola! You now have your “pages” as a sidebar module!

I decided to kill the tab that either says “Register” or “Site Admin” that appears in the header also.

Basically just follow the steps to remove the “Pages” from the header, except you are going to change this line:
<?php wp_register(‘<li class=”admintab”>’,'</li>’); ?>

to this:
<?php //wp_register(‘<li class=”admintab”>’,'</li>’); ?>