How To Check Number Is Odd Or Even

Here is a quick little snippet which can prove to be quite useful. This snippet will check to see if a number is odd or even. ## In Javascript function checkEven(val){ return (val%2 == 0); } v...

Get Url Sections In Javascript

Even though most of the time to get information from the page URL you will use the server side programming language, you can actually use Javascript to get the different sections that make up the URL...

How To 301 Redirect With PHP

Search engines index pages by the URL of the page, if these pages are moved to a different URL then the search engines will have indexed a page that no longer exists. Therefore people search in the s...

How To Create Stitched Look in CSS

The current trend in web design is textures with vintage design. One of the main aspects of this design is the use of stitches in your design, this used to have to be done using an image but thanks to...

Fallback on Local jQuery If CDN Fails

Many big websites are now offering CDN services for things like jQuery. Google offers a few of the biggest Javascript libraries from their own CDN network. Microsoft also allows you to use a CDN to i...

Create Pulse Effect With CSS3 Animation

In this tutorial you will learn how you can create a heartbeat pulse effect with CSS3. CSS3 gives us some added ability to CSS animation, with animation you can set key frame points to animate to. Th...

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...