Category Archives: Web Design

Use WordPress Themes and Functions on Other PHP Pages

Free Favicon

WordPress is a great content management system but there are still times when you either just want to add a page to your website that is not a part of WordPress or when perhaps you just want to give make sure all the pages on your website whether they are in WordPress or not all have the same look and feel. Thankfully WordPress has made it easy to make WordPress functions available on other PHP pages.

I recently wanted to redo Free Favicon and make sure the blog and the website all had a new fresh look. I had a theme in mind for the blog and want to make sure the rest of the pages had the same theme and look.

The first step is to include the WordPress wp-load.php file. This is the key to using WordPress functions, like loading theme files, outside of WordPress. For Free Favicon I simply added the code to load the wp-load.php file in the header template that the site was already using by adding a line similar to the following:

include($_SERVER['DOCUMENT_ROOT'].'/path to your wordpress install/wp-load.php');

Once wp-load.php was included you can access all of the WordPress functions so I could call the header and footer functions from the theme and have the site themed using the same WordPress theme the blog was using.

//call the theme header
get_header();

//call the theme footer
get_footer();

The only problem I ran into after getting the pages themed with the WordPress theme was how to change the title of the PHP pages with the new header. The original PHP pages had a section at the top of each of them that defined the title for the page. I just ran the WordPress filter wp_title and assigned the defined page titles from the PHP pages to be displayed using the WordPress theme.

function assignpagetitle() {
  global $documenttitle;
  return $documenttitle;
}
add_filter('wp_title', 'assignpagetitle');

Overall it was a pretty painless upgrade to Free Favicon, and a very easy way to make sure the whole site had a consistent look and feel. There are still some pages I left without the new theme and eventually I will probably getting around to fixing them as well.

Unsplash WP Plugin

I am always on the lookout for new and interesting photos for use in websites, blog posts and to pass on to clients. There are several places you can get free photos to use, in fact here is a list of 30 of them, but finding the perfect photo, downloading and uploading it again in… Continue Reading

Landing Page Design

I have been doing more research on best practices for landing pages recently and came across this great video on YouTube. I have watched and listened to this video several times now and thought I would share it. It has given me some great ideas to improve some landing pages for some of the pay… Continue Reading

Color Scheme Designer

I have talked about my problems picking colours in the past. Fortunately I have found several tools that can help me, and today I found another one. Color Scheme Designer is a Javascript, browser based application that you can use to create colour schemes based on the various colour rules (are they rules?), such as… Continue Reading

Add a Google Website Search

One of the things I have had on my to do list was to replace the WordPress search with the Google Custom search. The WordPress search gives decent search results, but it is hard to compete with the accuracy of Google website search. I was reminded about that today when I was searching for a… Continue Reading

Smush It!

Optimizing images for the Internet can be a pain staking task to make the image as small as possible while still making it look as good as it can. Back in the day when everyone was on dialup web developers used to spend lots of time to make sure those images were as small as… Continue Reading

51 RSS Buttons For Your Blog

It has been a very crazy week trying to get things done, so I have not had a chance to post as often as I wanted to this week. One of the many challanges of running a business and being a work from home Dad. I wanted to quickly point you to these 51 RSS… Continue Reading

Colour Lovers

If you have been visiting for a little while, or have browsed through some of the older posts (Color Combinations & Color Combinations Update) you know that one of the areas I struggle with is colour for websites. Because of this I am always on the look out for new colour ideas and tools to… Continue Reading

Internet Explorer – How I Loath Thee!

I have been back for just over a week now from a great week off up at Waskesui, in Prince Albert National Park. In the week I have been back I have been busy doing a redesign of a website for a client. The redesign is going well but there have been some problems with… Continue Reading