Posted on December 3rd, 2009 - WordPress | 0 Comments
Between the 15th of this month and the 6th of January I’ll be in Spain, woohooo!
Considering I manage quite a few different sites, most of which are highly content based (meaning they need to be updated regularly), leaving the country on holiday for three weeks doesn’t really sound like such a great idea. Thankfully I’m able to put in that extra bit of work now to keep my sites going while I’m away relaxing. By using WordPress’s post scheduling feature I have scheduled posts for many of my WordPress based sites – simple!
Another big thanks to WordPress!
Posted on November 3rd, 2009 - SEO | 0 Comments
At last, the big G finally rolled out a PageRank update. I can’t even remember the last time I saw an update happen so I was happy to see this one. All of my new sites (since the update) have been given some PR juice, all pretty low though – highest is PR3, some at PR2 and most at PR1. Some of my older sites lost their PR; they were only at PR1 though so that’s no problem really.
I just hope these PageRank updates become a bit more frequent. It’s nice to have some sort of realizable ladder to climb when doing SEO.
Posted on October 28th, 2009 - WordPress | 0 Comments
Spam is a major issue for a lot of bloggers and I’m one of them. I currently run quite a few WordPress based blogs on various topics and niches and although I knew about it I never got around to setting up Akismet. For those of you who don’t know, Akismet is a service which let’s you protect yourself against spam. It is available as a plug-in (comes packed with WordPress as standard) and only needs an API key from WordPress.com to work.
Before setting it up I was getting several hundred spam comments each week – I know this isn’t anywhere near as much as some get but still it was very annoying. A few days ago I thought I’d spend a minute on each of my blogs installing Akismet and since then exactly 0 spam comments have come through.
So I have to say, for all of you who aren’t yet using Akismet on your WordPress blogs – I highly recommend it.
Posted on October 23rd, 2009 - WordPress | 0 Comments
I just wanted to let you all know about post scheduling in WordPress. If you haven’t already given it a go I’d highly recommend you go take a look. Basically it allows you to instead of publishing a post immediately you can schedule it to be published at a specific time and date in the future. This means that if one day you manage to crunch out more posts than you normally would you could have them published in a few days or so instead.
For me this is great as I maintain quite a large amount of desktop wallpaper sites, all running on WordPress. All of these sites need to be kept up to date with regular wallpaper updates. Instead of dropping by every other day and adding a new wallpaper I just add a load of them every two weeks. Then, over the course of the next two weeks the wallpaper posts are automatically published without me doing anything.
Another great use for this is if you plan on going away for a little while. For example, over Christmas I’ll be away for about 3 weeks (Spain, wooohoooo!) but you can be sure that my sites will be kept up to date.
So go ahead, check it out! It’s on the top right hand side of the “Add New” section of WordPress.
Posted on October 22nd, 2009 - PHP | 0 Comments
I’m currently in the process of rebuilding one of my older sites from the ground up. One thing that the new version makes use of is a field in several database tables called ’state’. Basically, this holds an integer value ranging from 0 upwards where each number represents a specific meaning. For example…
0: Inactive
1: Active
2: Processed
3: Archived
The reasons for doing this are quite simple; it saves space in the database and is also a lot easier (and nicer) to work with.
Now, previously, when for example I wanted to loop through each row and display the textual meaning of each of the values I would either use a switch statement or a big if-else statement block. Now though I make use of a much simpler method…
1
2
3
4
5
6
7
8
9
| function number_state($state = 0, $labels = array())
{
$text = $labels[$state];
if($text == "")
$text = "Unknown";
return $text;
} |
This function simply takes two parameters. The first is the number itself; the second is an array of the corresponding value meanings. To use it just do this…
1
| echo number_state(1, array("State zero", "State one", "State two", "State three")); |
Or, in a simple loop…
1
2
3
4
| for($i = 0; $i <= 3; $i++)
{
echo number_state($i, array("State zero", "State one", "State two", "State three"));
} |
It’s a nice and simple solution to a simple problem. From my perspective it is much better having something like this compared to big chunks of code doing the same thing.
Posted on October 11th, 2009 - UI design | 1 Comment
I’ve just added a whole bunch of tweaks to my URL shortening site, Shrten. Some of the changes are visual though some are under the hood making the site easier to use and overall much, much better. But this post isn’t about that; it is instead about bookmarklets and how you can use them on your own site.
On Shrten you can now drag a link into your browsers toolbar and then when clicked it will instantly create you a shorter url for the page you are currently viewing.
This is the first time I’ve ever used a bookmarklet on any of my sites and I have to say that for apps and services such as URL shorteners it works fantastically! So, how can you do it?
It’s quite simple to be honest and consists of just a single link with a tiny bit of JavaScript. Take a look at this:
1
| <a href="javascript:void(location.href='http://shrten.com/url/'+location.href)">Shrten</a> |
The little snippet above is the exact bit of code I’m using on my site. Basically, when clicked it will redirect the user to http://shrten.com/x where x is the url of the current page the user is viewing. This can be put to all sorts of uses and I definitely recommend that you should take a look at it. It’s easy to implement and even easier to use!
Posted on October 10th, 2009 - WordPress | 0 Comments
Over the last couple of days and hopefully over the next couple of weeks I’ll be tweaking this site to make it that little bit better. This ranges from perfecting my permalink structure to dropping in some features and extras to help make browsing this site more enjoyable. One of the things which I done very early on when I was developing the theme to this site was to remove the WordPress calendar. I think you should do the same!
As long as your blog posts are not strictly tied to specific dates then ask yourself, do you actually need the WordPress calendar in your sidebar? To begin with, it usually looks terrible (it can be tricky to style) but it also serves no real purpose to your readers. Look at it from the readers perspective and ask yourself how many times have you ever used the calendar on someone else’s site to find what you’re looking for. Whilst some of you may be able to say ‘once or twice’ it really isn’t worth taking up all that space in your side bar when only a handful of people use it.
If people want something they will most likely make use of the search feature so I really don’t see why the calendar should be there. Keep your theme uncluttered and free from unnecessary bits like this.
Posted on October 8th, 2009 - SEO | 0 Comments
You may or may not know that when accessing a web site you usually have the choice of typing in http://www.domain.com or just http://domain.com -the difference is of course whether or not you include the www. Both of these will normally bring you to the exact same web site with no cosmetic differences what so ever.
The truth is that although including or excluding the www in a url makes absolutely no difference to the end user it can have a huge impact when it comes to search engines. For example, Google and Yahoo will treat both the http://www.domain.com and http://domain.com addresses as two completely different sites. So what does this mean? Well it means several things one of which is duplicate content. The search engines will see that both sites (although its the same site) have the same content and will therefore most likely exclude one from the search engines. With regards to Google PageRank your site will also be trated as two different sites each one having its own pagerank values assigned to it.
The fix is easy! Firstly decide whether you want to use the www version or the non-www version. To be honest it doesn’t really matter which one you use as long as you use just one of them. Then, you can either use some sort of 301 redirection or add one of these snippets of code into your .htaccess file.
Removing the www
1
2
3
| RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] |
Forcing the www
1
2
3
| RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] |
Of course in the examples above make sure you replace “domain.com” with whatever your actual domain is.
Posted on October 7th, 2009 - SEO | 0 Comments
My collection of sites is constantly growing – I seem to be launching at least one new site every month. Because of this and the work involved with getting these sites into the search engines I’ve decided to create a simple link exchange management script which I will use to manage any link exchange requests which anyone makes with any of my sites.
So, if you’re interested in exchanging links with any of my sites simply head on over to my link exchange manager where you can choose the site, pick the link placement and send me your link details.
I’ll do my best to accept/reject any exchange requests as soon as possible!
Posted on September 27th, 2009 - PHP, WordPress | 2 Comments
I run quite a few WordPress sites and one of the things I needed to do lately was to get the current page number in WordPress. It can be easily done. To grab the current WordPress page number just use the following.
1
| $pageID = (get_query_var('paged')) ? get_query_var('paged') : 1; |
And that’s all that’s to it. Then of course you can use simple if statement to do all sorts of things. For example, if you only wanted to display something on the very first page (or 2nd, 3rd, 4th, etc) you can do this.
1
2
3
4
5
6
| $pageID = (get_query_var('paged')) ? get_query_var('paged') : 1;
if($pageID == 1):
// Put your stuff here
<h2>This is only displayed on the first page</h2>
<p>Wooooo</p>
endif; |
Page numbers are simple in WordPress!