Archive for the ‘Wordpress’ Category

Googles Analytics for WordPress

Wednesday, July 1st, 2009

I installed Google Analytics a while back. When I launched my new blog theme a few days ago, I've since realised that I overwrote all the files for my theme and therefore replaced the Google Analytics code. I don't know if many people have made this mistake before, but it took me a few days to pick up on what I'd done. My Google Analytic stats weren't rising and I knew there was something wrong as I was checking my AWS stats that I installed as part of my hosting plan and this blog actually had it's best day of traffic since I started out. So this is just something to be aware of, if you're updating your WordPress theme. Yeah I know I'm spending lots of time looking at stats :) but I'll be making more of an effort to boost traffic very soon so it's something I need to be looking at.

Geographic distribution of visitors
Creative Commons License photo credit: richardmasoner

It's easiest just to place the Google Analytics code in footer.php as the footer shows up on every page and therefore this tracks all hits on your website. There's a nice article on exactly what to do over at ThemePlayground.com. It cleared things up for me as I previously thought I needed to put the Google Analytics code in a few different files, but it turns out that footer.php is the only place it needs to go! If you're using WordPress, there's lots of other nice tips on ThemePlayground and I'll be checking back there for a few tips and tricks as I continue to update this site.

http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/digg_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/reddit_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/delicious_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/blinklist_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/blogmarks_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/furl_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/newsvine_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/technorati_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/google_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/myspace_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/facebook_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/yahoobuzz_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/sphinn_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/twitter_32.png

Added SocioFluid Plugin to my blog

Saturday, June 13th, 2009

My custom theme design is near completion, and to compliment it I want to add as much interactivity and tools to increase traffic to this site as possible. The first thing I wanted to do was to add some social bookmarking links to the bottom of my posts. I had a look around and the plugin that I liked best was SocioFluid. Have a look at it in action below this post, I like how the images increase/decrease in size when you hover over them. It's easy to configure that way and you can select from a choice of 4 different image sizes when you configure the sociofluid plugin in the WordPress dashboard.

iPhone WebClip bookmark icons
Creative Commons License photo credit: aqhong

SocioFluid allows your site users to save bookmarks to the following sites: Digg, Reddit, DZone, StumbleUpon, del.icio.us, BlinkList, BlogMarks, Furl, NewsVine, Technorati, Magnolia, Google, Myspace, Facebook, Yahoo Buzz, Sphinn, Mixx, TwitThis, Jamespot and Meneame. You can configure the plugin to select any combination of bookmarking sites to add to the bottom of your posts. I think I'll be adding all of them, or at least as many of the more popular one's that I can fit into my new theme design...

This is only the first step, I plan on adding a lot more plugins to this site to increase my chances of getting some traffic and to encourage user activity. Next on the list will be TwitterCounter and Feedburner stat tools and I'll also be upgrading to a new comments plugin to further increase interaction with social networking sites. Admittedly, I'm not a member on all of these sites yet either so that'll be another step in working towards increases my blogs through awareness of these sites. I'll also be upgrading to WordPress 2.8 in the next few days and I'm hoping everything goes smoothly with that and the transition to my new theme..

http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/digg_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/reddit_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/delicious_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/blinklist_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/blogmarks_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/furl_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/newsvine_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/technorati_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/google_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/myspace_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/facebook_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/yahoobuzz_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/sphinn_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/twitter_32.png

Removing the index.php from your URLs using WordPress permalinks

Tuesday, May 19th, 2009

As I mentioned previously, I want to use permalinks to remove index.php from my URLs, and needed to update the .htaccess file in the root of my blog folder to do so. The site I did this for; TopCommentator.com, is hosted on a linux server so the .htaccess file should reside in the /webspace/httpdocs folder.

When I installed WordPress (version 2.7.1), there was no .htaccess file as part of the installation so I got the following warning/error messages when I tried to update your permalinks structure in the WordPress dashboard under Settings >> Permalinks (at the bottom left of your WP dashboard):

If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.

What you'll be selecting is the following code which is placed below the message at the bottom of the page:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Copy the code into a text editor (I used notepad) and save the file as a.htaccess. Upload a.htaccess to your server, (I use FileZilla ftp client). If you cannot see the .htacces file from within your web space file manager or ftp client, you'll need to make sure that you have selected the show hidden files option (for FileZilla go to : Server >> Force Showing Hidden Files). Rename a.htaccess to .htaccess and change the file permissions so that the file is writable. To do this in FileZilla, right click on the .htaccess file and select File Permissions.... I chose to set the file permissions as chmod 664 (see screenshot below):

Setting htaccess file permissions

Initially when I uploaded the file and changed the permissions as above I still received the error message saying that .htaccess was not writable. I had followed the instructions and was not sure what was wrong. I called my hosting account's support number and many thanks to Jonathan who was able to tell me that I needed to remove some extra characters (  )added to the start of the file (see how this looked below):

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

This happened after copy/pasting the code from the WP dashboard and saving it as a notepad file. The extra characters cannot be seen when opening the file in notepad and Jonathon recommended using notepad2 to view files that I'm uploading to my Linux hosting account (so i'll be doing this form now on). When I removed the characters from the start of the file everything worked fine and I got the nice clean permalinks that I wanted. I use /%postname%/ only in the custom permalink structure as this is what I wanted (see below):

using postname only in Wordpress permalinks custom structure

So now instead of http://www.topcommentator.com/index.php/about/ appearing in the browser address bar I now have the clean permalink with index.php removed that I wanted: http://www.topcommentator.com/about/. Something I could not find when trying to solve this problem (although it probably exists somewhere) was a working version of the .htaccess file with the correct permissions set. If you like download an exact copy of my sample .htaccess file here, unzip and upload to your web space and hopefully this works for you to. If your blog resides in a sub folder under your root domain eg. blog, you'll need to place the .htaccess file in folder and update the file to include the sub folder name as below:

# BEGIN WordPress
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
# END WordPress

Hopefully someone gets some value out of this in the future as it took me a while to sort it out :)

http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/digg_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/reddit_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/delicious_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/blinklist_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/blogmarks_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/furl_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/newsvine_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/technorati_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/google_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/myspace_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/facebook_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/yahoobuzz_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/sphinn_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/twitter_32.png

Editing the ad spaces for the Dark Zen Wordpress theme

Monday, May 18th, 2009

I recently mentioned that I started a new project for TopCommentator.com. This project will take me a while to get off the ground (I'm guessing a bit longer than the week or two I predicted :) ) but the first decision I made was to use the Darkzen WordPress theme. It's a nice clean theme with ad space integrated into it, and after browsing the free themes directory it's the one that I happiest to go ahead with as a base for this project.

One of the first things I looked at was how to edit the existing ads in the theme. I saw this question asked in the support forums so decided to make a post from it. So here goes:

1. In your root web space locate sidebar.php under root\wp-content\themes\darkzen (see note at bottom if you prefer to do this within WordPress dashboard)

2. Open sidebar.php and search for advertarea. You will then see where the ads are places as below (click on the image to see full size):

3. Change the # in href="#" to the url that you want to point your ad to (shown in red below). Overwrite the images /images/advert1.jpg under root\wp-content\themes\darkzen\images folder in your web space (shown in blue). Alternatively, you can place a new image in your images folder and change the code to point to the name of this new image. Finally update the alternative text field alt="advert1" (shown in green) to something suitable for the description of your ad.

4. If you add or remove some advertisements (the Darkzen theme comes with 6 ads as default) you can add or remove lines of code (shown in pink above) and update the fields to appropriate values as described in steps 1 to 3.

5. To update the banner in the header you'll need to search for the headright class in header.php and follow steps 1 to 3 to update the ad.jpg image and other fields.

Note: You'll need access to your web space to overwrite existing or add new images. To edit files from within WordPress navigate to Appearance >> Editor from within the WordPress dashboard and click on the theme file on the right hand side of the page.

If you found this helpful or have any feedback or questions please feel free to drop me a comment and I'll try to get back asap.

http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/digg_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/reddit_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/delicious_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/blinklist_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/blogmarks_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/furl_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/newsvine_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/technorati_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/google_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/myspace_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/facebook_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/yahoobuzz_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/sphinn_32.png http://www.iliveontheweb.com/wp-content/plugins/sociofluid/images/twitter_32.png