Social Media Colours

Whenever creating a new site I always find myself going to the major social networking sites to grab their colours to use in icons or buttons. Instead of having to go to all these individual sites I wanted one place to go and get these colours when I needed them. So here's a list of some of the major social media network colours. Facebook Hex: #3b5998 RGB: 59, 89, 152

Read more...

Get A List Of All Theme Page Templates

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. Create Page Template To create a custom page template all you have to do is add a new blank php file to your theme directory and save this as custom_page_template.php. Within this new file all you have to do is

Read more...

Force Sub Categories To Use Parent Category Templates

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 actually only needs one template file to work correctly, the index.php file. Depending on what content you are viewing you can create a different page template to show this in a different way. For example if you are looking at

Read more...

Get Image Src With PHP

There are some occasions where you need to get the attribute value in PHP from a HTML element, this can be for migration reasons or perhaps you are writing a script to scrap a website to store the values found. I was writing a script that needed to scrape a web page and pick up all the URLs for the images on the page and store the src values. You

Read more...

Remove Query String From Stylesheets In WordPress

A website owner should always be trying to improve the speed of their website as much as possible. In WordPress there are many things you can do to help improve the performance of your website. Tips to improve the performance of your WordPress website When you run your website through speed tests such as Google Page Speed test one of the things they will flag up is the loading static

Read more...

File_Exists For Remote URL

If you want to make sure that a file exists in PHP you can use the function file_exists(), which takes one parameter of the filename. This function will not only work for files but will also work for directories, you can pass in a filename of the directory and if this directory exists the file_exists() function will return true. The problem I've seen with this function is that people have

Read more...

Getting Started With SASS

If you do any front-end development over the past couple of years then you would of heard of CSS pre-processors. The most common CSS pre-processors are SASS, LESS, or Stylus. CSS pre-processors are scripts that will compile code and output the results into CSS stylesheets. They allow you to create more dynamic, optimized and organised CSS for your websites. In this article I am going to investigate what it is

Read more...

Sticky Posts In WordPress

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 list of posts. If you use your WordPress site as a normal blog and have a list of posts of the homepage of your site, making a post sticky will ensure that this post appears at the top of the

Read more...

Update Row With Highest ID In MySQL

Recently needed to update the last inserted row of a table but didn't have anyway in knowing what the highest ID in the table was. I can easily do this by using the max() function to select the highest ID in the table. Then I can use the result of this query in the UPDATE query to edit the record with the highest ID. But this is quite a easy

Read more...

Share Multisite Media Libraries

When you use WordPress multisite functionality you are creating a brand new site for each site in the network. This means that they will use different content, different menus and different widgets. They can re-use the same plugins and themes as each other but they are treated as completely different sites. While doing client work with WordPress multisite I've noticed that most sites want to kept separate but because they

Read more...

1 2 3 4 5 6 7 8 9 10 11 12 13 67