Boilerplate CSS Media Queries

In a previous snippet you would of seen a boilerplate for iOS media queries. Below is a CSS snippet expanding the previous snippet to use media queries on other smartphones. /* Smartphones (port...

How To Create An Animated Scroll To Top Button With jQuery

Creating a good user experience on your website is very important to keep people on the page. The best way to create a good user experience is to make it easy for people to use, if your site is diffi...

Use PHP To Get The Real IP Address

If you want to record the visitors IP Address there are a few things you need to remember, computers on shared internet connections can have different IP Addresses and visitors coming to your website...

Reduce Comment Spam With htaccess

Comment spam is a problem with many blogs, one of the biggest is spam bots crawling sites and automatically submitting comments to your site. The below code snippet will check the HTTP_REFERER on the...

Exclude Categories From RSS Feed In Wordpress

In a previous snippet you would of seen that you can change the Wordpress have_posts() method to exclude a category from the index page but you can also exclude a category from the RSS feed. Below is...

Cross Browser CSS Opacity Property

With CSS3 new features most of the browsers don't use the same properties they need to be prefixed with the browser specific property. For example firefox is always prefixed with a -moz- and the chro...

iOS Media Queries Boilerplate

Media Queries are now becoming quite common practice in web design. They allow you to change the CSS of the different elements on your web page depending on the size of the screen the visitor currentl...

How To Exclude Category From Index.php In Wordpress

Sometimes you have a category in your blog which you want posts for but don't want these posts to be excluded in your main index page. Is blog is a good example of this scenario, I exclude the snipp...

How To Use Your Gravatar as Favicon

A favicon (short for ‘favorites icon’), are little icons associated with a particular website shown next to the site’s name in the URL bar of most browsers. This will also appear in...

How To Make Random Hex Colour In Javascript

In this tutorial you will learn how to create random colours using Javascript. To create a random colour in Javascript it is a simple function. function random_colour(){ return Math.floor(M...

Add Paypal Donate Wordpress Shortcode

In a previous post we had a snippet on how you can make money on your Wordpress blog by placing Google Adsense on your website. This snippet was a shortcode so you can add the Google Adsense anywhere...

Toggle Show/Hide HTML Element

Below is different ways you can show or hide content. Javascript Is a function using raw Javascript which is passed an ID of a HTML element. We then use the getElementById function to get the element....

WordPress Google Adsense Shortcode

Wordpress allows you to add shortcodes in your functions.php file. Shortcodes a bits of code you add to your content box and Wordpress will run a piece of code in this spot. A previous example of sho...

Limit WordPress Search Results To Certain Post Types

In Wordpress version 3.0 they introduced the ability to have custom post types for your Wordpress blog. This means that instead of using categories to separate your different post types you can actua...

How To Create Title Tag In Wordpress

Depending on what page you are on you need to make sure that the title tag is different on each page. This is important for SEO because you can't have pages with the same title tag. As Wordpress is a...