]> Basics | Web Developer Reference Blog

Open comment authors website link in a new window

Tuesday, June 8th, 2010

When a user posts a comment on your blog, they are given the option to have their name linked to their own website by supplying the URL when they post. To make these links open in a new window:

find in wp-includes/comment-template.php (~line 148):

$return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";

replace with:

$return = "<a href='$url' rel='external nofollow' class='url' target='_blank'>$author</a>";

And that’s it. If you have difficulties implementing this, contact me for paid support.

Give your website an icon

Sunday, June 6th, 2010

Personalise your users experience with the use of a favicon.ico file. Web browsers check to see if you site has a Favourites Icon which allows a user to easily identify your website in their favourites list. Some browsers; most popularly Chrome, FireFox, and IE 7+; show the icon in the tabs for easy identification.

(more…)

PHP Objects, The Basics

Friday, February 26th, 2010

I have come across classes very often and use classes distributed on phpclasses.org such as phpMailer, an excellent class for sending emails using PHP. A class allows programmers to separate code from the main systems while being able to access and define variables for access outside the class, inside the class or just within one function in the class.

In this article I will discuss the general structure of a simple class and usage of a simple “HELLO” class as an example.

(more…)

HTML Standards

Thursday, February 25th, 2010

The fundamental reason for HTML standards compliance is to ensure that you use only those elements and structures that are likely to be understood by the widest range of user agents.

It’s like English – if I were to speak East Anglian most other English speakers would not understand everything I say.
Similarly, if you use proprietary dialects of HTML, some user agents won’t understand everything you write.

There is however, a standard for HTML which the browser makers say they support, and validation points out the potential problems in your HTML source. By adhering to the standards you maximise the accessibility of your work to the widest range of user agents, and therefore, users.