|  About  |  Archives  |  Log in  | 

Archive for the 'WordPress' Category

Traffic

From the statistics collected at StatCounter (it's free…) about the traffic on this blog, I can see that over the past couple of weeks, quite a few people have found their way to the Linksys WRT54G wireless bridge posts (see the original post and the update). These visitors primarily come from the US and arrive here from search engines.

In terms of the usual traffic on this site, "quite a few" translates into "more than a handful" in absolute terms.

Feedback on these posts is warmly welcomed so if you have hit this blog looking for information on how to setup the Linksys WRT54G router, DD-WRT WRT54G firmware and/or wireless bridges, please feel free to let me know if you found the posts useful or not.

The preferred way of doing so is by commenting the posts, but email is ok too.

Thanks in advance

/christopher

If you enjoyed this post, make sure you subscribe to my RSS feed!

Related Posts Plugin Update

I have just finished updating the plugin I use to display links to related posts when a single post is displayed. The old version only permitted links to related posts to be displayed below the comments section - a placement somewhat too inconspicuous.

The new version is hooked into the Wordpress loop differently, which allow links to related posts to be placed pretty much anywhere.

Because I already have the plugin installed (and have appropriate database tables in place), I needed to run a small upgrade script - 'upgrade_related.php'. The script did not run straight off the bat because it references some variables, which are not declared anywhere. I had to add the following declarations at the bottom of 'wp-config.php' in the root folder of the Wordpress installation.

$server = DB_HOST;
$loginsql = DB_USER;
$passsql = DB_PASSWORD;
$base = DB_NAME;

Next, I added some code to 'single.php' - just above the post meta information - to actually display the links to related posts:

<?php echo related($post->post_title); ?>

If you click a permalink to one of my posts, you will see the links to related posts at the end of the post text, just above the meta information of the post.

***** UPDATE *****
It appears that the 'Related Posts' plugin graps everything from the database, including unpublished posts.

***** UPDATE #1 *****
Fixed the 'get-everything' issue, by hacking the SQL statement in 'related.php' to only fetch published posts:

$sql = "SELECT ID, post_title, post_content, post_excerpt, post_date, post_status, MATCH(post_title,post_content) AGAINST ('".$stuff."') AS score FROM
"
.$table_prefix."posts WHERE post_status = 'publish' AND MATCH (post_title,post_content) AGAINST ('".$stuff."') AND ID <> ".$post->ID." LIMIT 0,".$max_related;

This excludes drafts, private and static (pages) posts.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Modification of Top 10 Posts plugin

As is evident from looking at the sidebar to the right of this text, I am using the 'Top 10 posts and Views per post' WP plugin by Mark Ghosh. I am very happy with the "viewer popularity" rating this plugin provides, but I have been a little annoyed with my own page views being included in the view counts. Due to Adsense concerns, I have disabled the post preview in the WP post editor. This means that I tend go back and forth between viewing and editing a post - something which would capsize the view count.

I therefore decided to take a look at the plugin code, to see if it could somehow be modified to exclude requests made from the IP-addresses, I use.

The solution I came up with is shown in the code fragment below - I have added an IP check in lines 56 - 60 in

'top10.php'

.

$ip = $_SERVER['REMOTE_ADDR'];
$me = FALSE;
$me = ($ip == '<INSERT FIRST IP HERE>' || $ip == '<INSERT OTHER IP HERE>');
global $id, $wpdb, $single;
if ($single && isset($id) && $id > 0 && !$me) {…

Now, I have no experience with PHP so I am not sure if this hack is 'come il faut' PHP, but it works :)

In the code shown above, I only exclude two IP adresses: The one at home and the one at work. It is entirely possible to exclude more, but I mostly access the blog from either one of those addresses, so excluding them removes the worst "error weigh in" in the view count.

If you enjoyed this post, make sure you subscribe to my RSS feed!

WordPress Plugins & Themes

Here is a list of the WordPress plugins I have installed so far:

And some themes I am trying out:

Themes and plugins I am considering:

If you enjoyed this post, make sure you subscribe to my RSS feed!