Theme Development

90 Lessons To Learn And Code

How To Disable Auto WordPress Responsive Images

January 21

As of 4.4 WordPress will automatically add the srcset attribute to the images in your content. The srcset attribute allows you to define different images to use at different viewport...

Dequeue Styles and Scripts In WordPress

February 27

When developing on WordPress one of the first things you need to learn about is how to add Javascript and Stylesheets to your page correctly. If you're new to WordPress...


Wp_title In WordPress 4.4

November 30

Recently I wrote an article about what is coming in the next version of WordPress and one of those was the changes to do with the wp_title() function. There seems...


Display Content For Registered Only Users In WordPress

June 11

The registered users of your website are the most valuable visitors you can get on your website, these people are loyal visitors and you should reward them for that. One...


Create Your Own Pagination Links

May 21

When you are developing themes in WordPress you will first see that the query returns 10 posts at a time, this is because there is an in-built pagination that will...


Get A List Of All Theme Page Templates

April 28

WordPress allows you to create custom page templates to use through out your site, using these page templates you can completely change the look and functionality of a certain page....

Force Sub Categories To Use Parent Category Templates

April 23

When doing WordPress theme development the first thing you will learn about is the template hierarchy, this is the order of templates WordPress will use to display the content. WordPress...

Sticky Posts In WordPress

April 14

As of WordPress version 2.7 you've been able to assign some posts to be sticky, a sticky post will make sure that this post appears at the top of the...

Password Protected Pages Excerpt

March 26

When you display list posts in WordPress and want to display a snippet of the post content, there are two ways you can do this. You can either use the...

Hide Content on Password Protected Pages

March 25

On private websites it can be handy to have password protected pages to stop everyone getting at some pieces of content. In WordPress creating a password protected page is very...


Change The Password Protected Text In WordPress

March 19

One of the features that I've found content editors find really useful is the password protected pages in WordPress. This is a built in feature that you can use directly...


Get Title Of Post Outside The Loop

February 28

For theme developers it is important that your theme page displays the correct page title. There can be some confusion in theme developer when they are working on a static...


Access Database Outside Of WordPress

February 24

Sometimes I've needed to build a new page outside of WordPress but still have the ability to access the WordPress database from this new page. This would normally use custom...


Change Default Theme For WordPress Multisites

February 12

When you create a new site in WordPress multisite it will automatically assign a theme to the new site. It does not use the theme that you have activate on...

Remove Protected: From Post Titles

February 10

In WordPress you can easily password protect a page from the admin area. All you have to do is under the publish block edit visibility and select password protected. A...


Override Parent Theme Functions

February 3

Child themes is functionality that allows you to inherit the templates and functions of another theme. Using the child theme to can inherit all the styling of the parent to...

Trim Post Content Outside Of Loop

January 27

The WordPress loop is used in the theme files to display the post content, when you are inside the loop there are two main methods you can use to display...

Stop WordPress Including jQuery Migrate File

January 23

In WordPress version 3.6 when WordPress loads the built in jQuery file it will also load in the jQuery migrate file. The jQuery migrate file was introduced in version 1.9...


Automatically Link Twitter Usernames In Content

January 9

If you mention people in your WordPress posts or link to your own Twitter profile in a post you can use the following code snippet to automatically asd a link...


List Of Pages Using A Page Template

January 6

There are a few differences between using pages or posts, one of the biggest difference between these post types are that pages can be assigned a page template which allow...


Order By Meta Values Using WP_Query

December 17

With WordPress you can use multiple ways to get a list of posts or content items, some of them will allow you to get the default posts and pages so...


Custom WordPress Customizer Controls

November 27

In a previous tutorial I spoke about the WordPress theme customizer and how you can use this feature to make it easy for your users to change the theme straight...


WordPress Theme Files

November 25

WordPress theme files are just PHP files used to display the HTML and the database output of your WordPress website. Theme files should be used to style your website and...

Get Theme Directory In WordPress

November 18

When you doing theme development there are times when you need to reference a file in the same folder of the current theme. You may need to include a file...


When the_content() Ignores More Comment

November 12

In WordPress there is a special HTML comment called more. <!--more--> This comment allows you to put a stopping point in the content of the post, this is then searched...


Load Google jQuery UI Theme CDN In WordPress

October 22

WordPress comes with a number of built in Javascript and Stylesheet libraries which you can use in your application. One of these libraries is jQuery UI which you can easily...


Add To Your WordPress Theme

October 21

All of the major search engines Google, Yahoo and Bing got together to come up with a way webmasters can better define the content on the page to give search...


Validate Featured Image On Post

May 6

Since WordPress version 2.9 you have been able to add a post thumbnail to all your posts on your website. A post thumbnail is called a featured image for the...


Display A List Of Authors On WordPress

April 29

On some blogs it is important to post on a regular basis, but this can be difficult unless blogging is your full time job. For a single person to regularly...


Force SSL On Certain WordPress Pages

April 10

There are going to be certain pages that you want to force SSL, so that the browser will redirect you to this page using a HTTPS connection so the data...

Check If A Sidebar Has Widgets Assigned

March 25

To display a sidebar in your WordPress site you first need to register the sidebar so that WordPress can assign widgets to it. When a sidebar is registered it will...


How To Create Custom Queries In WordPress

March 18

All the data you enter into WordPress will get stored in the database, depending on what page you are on WordPress will query the database in a different way. If...


WordPress Reset The Post Data

March 6

If you are developing a WordPress theme then you would understand all about the WordPress loop. This is the code that is used to display the posts on the correct...


Create A Custom Background For WordPress

February 4

Custom backgrounds is a WordPress theme feature that allows the users of the theme to change the style of the background. It allows the users to pick a new color...


Create A Page Template For Logged In Users

January 28

There are times that you would want a page only to be accessible for users which have logged into your the WordPress user manager. Such as if you have a...


Create Post Tags With CSS

January 22

In this tutorial we are going to create post tags using CSS, we will also create a WordPress widget that will allow you to display these post tags in the...


Creating Your Own Theme Customiser Custom Controls

January 7

In a previous tutorial I wrote about the new theme customiser page and how you can use this to change the styling and functionality of your WordPress theme. In this...


Using WordPress New Theme Customiser

December 24

In a previous tutorial I wrote about how you can create your own theme options page in WordPress. Well now this tutorial is no longer needed for themes anyway. For...


Add Category RSS Feed Link

December 9

When you have a WordPress site you can assign different posts to categories, this allows you to group your posts together. For example on this site I have created categories...


Get All Categories In WordPress

December 4

There are times when you want to get a list of all the categories of your WordPress site, this is commonly found on a archive page. But I've recently created...


Using The Wp_Editor() Function On Theme Options

November 27

In previous tutorial you would of learnt how you can create a themes options page for your WordPress theme, I have also wrote tutorials on how you can create a...


Get The Current Post Type In WordPress

November 26

I recently had to make a theme that used similar code on different custom post types. For this I want to do something different depending on the post type. To...


How To Change The Language Of Your WordPress Site

November 19

When you install WordPress the default language is set to be US English. But this doesn't mean it has to be this language, you can change the language used on...


Override WordPress Site URL With wp-config.php

November 14

Wordpress is a CMS, which means that most of the data is and should be stored on the database. Two of the most important data that is stored in the...


Add Colour Picker To WordPress Admin

October 15

In a previous tutorial you would of learnt how you can create your own theme options page using the Settings API. You might of also seen the tutorial about default...


Redirect To Post If Search Results Return One Post

October 9

Wordpress has a built in search functionality which allows your visitor to easily search for posts on the blog. It can search for keywords in the post title and in...


Get Current Page Template

October 7

Sometimes in WordPress development you will need to display certain theme files, using the rewrite engine. For example using custom post types will use a file name single-{posttype}.php, but if...


Create A Random Post Custom Page

October 3

In a previous tutorial you would of learnt how you can create custom page templates to add additional functionality to your theme. Some of the example pages mentioned were: Contact...


Custom CSS On Single Posts

September 28

In a previous tutorial you would of learnt how to attach extra data to your single posts by creating custom post meta boxes. Create WordPress Post Custom Meta Boxes One...

Display A WordPress Search Form

September 24

Wordpress has an built in search facility which will allow you to search for keywords within your posts search in either the post title or the post content. In order...

Create WordPress Post Custom Meta Boxes

September 5

At the bottom of my posts you will sometimes see a couple of embedded tweets near the comments section. Many people have asked me how this appears on the site...


Create A Helpful WordPress 404 Page

August 24

When your server can't find the requested page it will return a HTTP status code of 404. This tells the browser that the request has failed because the page you...

Add Stylesheets To WordPress Correctly

August 8

When you are developing WordPress plugin or theme then you will always get to a point where you want to add a stylesheet to the page so you can use...


Make Content Clickable In WordPress

July 13

Wordpress has a great feature I've just discovered which allows you to convert plain text into links for URLs or email addresses. If your content has URLs in the content...


What Does Your WordPress Theme Support?

July 2

By default your WordPress themes will support a number of features like these: Custom headers Custom Backgrounds Post Thumbnails Menus Automatic Feed Links Editor Style Widgets Before WordPress 3.4 you...


Display Code Snippets In WordPress

June 29

If you want to talk about programming or development in your WordPress post then there will be times when you want to write about code but make sure that the...


WordPress File Header Comments

June 25

The best thing about WordPress is that everything it does is extensible, this means that developers can do anything they want by building on top of the WordPress framework. When...


Display A Message On Old WordPress Posts

June 18

If your blog has been around for a while then some of your earlier posts may have information on there which is out of date. For example on this blog...


Get WordPress Theme Information

June 15

When you create a WordPress theme you need to add comments to the top of the stylesheet so that WordPress will understand that this is the main stylesheet for your...


WordPress Theme CSS Starter

June 11

Creating a WordPress theme can be lots of work, but the basic HTML for themes are normally quite similar. Each theme will have a way of looping through a list...


7 Tips To Improve Your WordPress RSS Feed

June 1

Here is a list of 7 tips you can use to help improve your WordPress RSS feed. Add Link Back To Original Post One of the problems with having an...


Add Search Form To A WordPress Menu

May 13

Wordpress comes with the functionality to create menus in the dashboard area, from here you can select pages or custom custom menu items to make up your menu. Menus are...


How To Exclude Posts From WordPress Search

May 12

There may be times when you have a little rant of make a mistake in a post and want to exclude this from the in-built WordPress search functionality. There is...


Display The Post Date In WordPress

May 8

If you are building a WordPress theme then there will a time when you want to display the date for the current post, luckily for you this is very easy...


What Makes A Premium WordPress Theme Premium?

January 30

Recently I've been doing a lot of work with WordPress, developing plugins and developing themes. I've looked into some of the top WordPress premium themes to see how they work...


How To Display Future Posts In WordPress

January 22

It is recommended that you don't over load your readers by posting all the time, so if you write more than one post a day you should try to use...


Add Body Class To Your WordPress Theme

January 21

Wordpress allows you to dynamically add CSS classes to the body tag of your WordPress theme. This will allow you to completely change the look and style of your theme....


How To Display Author Avatar In Post

January 13

In WordPress you can assign avatars to your authors, but if you have avatars then you need to be able to use them. In this snippet you will see how...


How To Display Related Posts by Author In WordPress

January 12

In a previous article you would of learnt How To Get Related Posts For WordPress Post. With a blog that has multiple authors you may want to display posts which...


Automatically Add Google+ Button After Post

January 11

Google+ is the latest social media trend to hit the internet, it is growing in users all the time and it is fast becoming a very engaging community. You will...

Replace jQuery With CDN In WordPress

January 9

Here is a snippet which allows you to load jQuery from the Google CDN in WordPress. jQuery is a very popular Javascript framework which can do some very powerful things...


How To Exclude Category From Index.php In WordPress

December 19

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.


Limit WordPress Search Results To Certain Post Types

November 30

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


How To Create Title Tag In WordPress

November 29

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


Automatically Empty Trash Posts In WordPress

November 11

Do you create posts just to delete them half way when you realise their not good enough to be put up on your site? Lots of people create a post...


Change End Excerpt In WordPress

November 11

Wordpress is a popular blogging software that allows you complete freedom on how you display the posts to your visitors. It is common on most blogs to have a snippet...


Automatically Replace Words With Affiliate Links

October 9

Using WordPress it allows you to add bits of extra code to change the framework by using WordPress hooks. Some of the most popular places to add hooks is before...


Converting XHTML WordPress Theme To HTML5

October 7

HTML5 is here! It's been around for awhile now and it's still isn't as widely used as I thought it would be by this time. In my earlier theme I...


Get Related Posts For WordPress Post

September 21

Interlinks in your blog posts will allow your visitors to get related content to the current post. This will build up page views on your blog and build visitor engagement....


How To List All Authors On Your WordPress Blog

September 5

On some blogs it is important to post on a regular basis, but this can be difficult unless blogging is your full time job. For a single person to regular...


How To Separate Post Excerpts In Boxes

August 18

In my current WordPress theme I display the most recent posts on the index page. I don't display all of the post as I think it will be a bit...


Automatically Insert Post Author Bio On All Posts

August 13

As shown in a previous post you can automatically add custom content after all wordpress posts using WordPress hooks. This is a perfect place to make sure you give your...


Add Custom Content After All WordPress Posts

August 13

There may be a time when you want to display a message at the end of all your posts on your wordpress blog. This can be for any promotional messages...


Display Breadcrumbs On WordPress Post Without Plugin

July 27

Breadcrumbs are used to show the process to which you would navigate to a page. For posts on your wordpress blog you can use breadcrumbs on your posts to show...


Add Link Around WordPress Post Featured Image

July 20

Since WordPress version 3.0 it added a feature that will allow you to add featured images to your WordPress posts. This can easily by done by using the set featured...


Files Needed To Create A WordPress Theme

July 14

What Makes Up A WordPress Theme So I decided to build my own wordpress theme for this blog. The main reason for this is so I can make it exactly...


Change style depending on User Browser in WordPress

July 1

In wordpress it is possible to change the body tag class to something depending on the browser the user is on. This is done by using a hook with a...


Add Google Analytics To Your WordPress Site

June 29

Google analytics is a functionality that you will need on almost all of the websites you create. It allows you to track all sorts of data about the visitors of...


Add Custom Favicon To Your WordPress Blog

June 27

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


WordPress Change Excerpt Length

June 22

In WordPress you can apply a excerpt to blog posts to give a preview of the post which is most likely used on category or search pages. The default for...