Tell WordPress to Use the Default Theme

September 24, 2009

The $theme variable of wordpress control the apparence of your wordpress, its value is the name of your wordpress theme. We’ll show you how you can switch themes using a simple code snippet. Just paste the following code in the functions.php file. When this code will be executed, the “default” theme will replace your current theme. add_filter('option_template', 'themechoose'); add_filter('template', 'themechoose'); add_filter('option_template', 'themechoose'); add_filter('option_stylesheet', 'themechoose'); function... [Read the full story]

Prevent WordPress Plugins From Breaking Your Theme

November 24, 2008

Have you ever deactivated a WordPress plugin only to find that your WordPress blog no longer works?   This is something that can happen in any situation where a WordPress plugin is called by your WordPress theme without using the proper statement.   How Can I Avoid This Problem? Whenever you add plugin functionality to your WordPress theme that uses a call, make sure to turn it into a variable, so your theme won’t break if the plugin is deactivated.  An example would be the popular Related posts plugin that most... [Read the full story]

Add meta description to your wordpress theme

October 27, 2008

Open your header.php file. Paste the following code anywhere within the <head> and </head> tags: <?php if ( (is_home()) || (is_front_page()) ) { ?> <meta name="description" content="Blog description goes here" /> <?php } elseif (is_single()) { ?> <meta name="description" content="<?php the_excerpt();?>"/> <?php } ?> Good job! Your theme now have meta description on the homepage as well as single posts. Also, we should create another conditionnal structure to handle categories.  Read More →

Use multiple custom headers on a WordPress theme

October 24, 2008

Do you ever wanted to have multiple headers on your WordPress blog? If yes, here’s a clear and concise tutorial that will help you to get themost out of your blog headers! The first thing to do is to create header files. Create as many different headers as you want. In this exemple, I have created 3 custom headers from my theme default file header.php, names headercontact.php, headergallery.php and headerdefault.php. By using the php include() function and WordPress conditional tags, we can define custom headers easily. Replace... [Read the full story]

Add Social Bookmark Links to your Theme

August 5, 2008

Many visitors will not vote for you posts on digg or stumbleupon simply because they read and enjoyed it. They simply don’t think about it, exepted if they come from one of theses websites. Most social bookmarking sites provides widgets to add to your blog to provide your visitors an easy way to vote for your post. This is functionally good, but what about create something more personal, which will perfectly fit your blog theme colors? Creating the widget Chose to display the multi-widget at the bottom of each post. Like... [Read the full story]

Page 1 of 212»