Changing Your WordPress Permalinks
Don’t you just hate those URL’s you get when using the default setup of WordPress that look something like:
They really don’t help with your Google rating at all, and that is something that should make you rush to make changes.
I always use the following format, and believe that this is what many others use also:
To do this, go to Settings>>Permalinks & select the Custom Structure, and type in:
This structure is fine for smaller blogs but may cause performance
problems with larger sites. To find out more about this, take a look at
How To Set a Static Page in WordPress
Nothing looks more bloggy than a home page with a list of latest posts.
This is why you may want to consider using one of your pages as the home page instead of the traditional one.
To do this, go to Settings>>Reading and select the page that you would like to use as your home page.
Creating Page Templates in WordPress
To create a different
look for different pages, you just need to create new page files, which
can then be uploaded to your main theme’s folder and selected from a
drop-down menu whenever a page is created or edited.
The easiest way to do this, is to edit the current page.php file, and make your changes to it, save it under a different name, such as page2.php, and then select it if you want to use that design.
Of course, it would be best to name it
something more descriptive, especially if you create a variety of
different templates, as you will then know where you are when editing
At the top of the new template page, you will need to have the following:
Template Name: YOUR TEMPLATE NAME
Creating Category and Post Templates in WordPress
There are ways to
create a different look to various categories by hard-coding, but there
is a much simpler way, and that is by using the Idealien Category
Not only will this allow you to have a different look to the category.php page
but, depending on the category you are in, it also allows you to have a
specific look to all posts in a certain category/sub-category.
This involves adding code at the top of
each edited category page, in the same way as with the page template
above. This code is:
Category Template: Custom Template Name
I have found that the section of this
plugin that deals with linking in your seperate single.php files does
not always work correctly, as it doesn’t seem to call the seperate file.
If this happens, then don’t panic, as there is a plugin that deals with this very nicely.
The Single Post Template plugin
allows you to easily add as many templates to your create/edit posts
section of admin, and you can then select the template you wish to use
for each post. This is probably a much better way to deal with it if
your posts are in multiple categories, as you get to choose which
template to use.
Simple Redirection in WordPress
If you want to have full control over
your menus, enabling you to link easily to posts or external links from
a page menu, this is very simple to do, with very little editing.
Open your page.php file, and find the following:
<?php get_header(); ?>
Change this to the following:
global $post; // < — globalize, just in case
$field = get_post_meta($post->ID, ‘redirect’, true);
if($field) wp_redirect(clean_url($field), 301);
Once you have done this, you can create a simple redirect by creating a new page and using the custom fields section.
Value: FULL URL TO WHERE YOU WANT TO REDIRECT
Showing Alternate Headers on your WordPress Pages and Posts
If you want to show
different headers, depending on which part of your site users are on,
you can do this by replacing a single line of code.
Find the following line of code in a file such as page.php, single.php, category.php, etc:
<?php get_header(); ?>
Replace this with this code:
<?php include (‘ALTERNATEFILE.php’); ?>
To make this easy on yourself, you should use alternate names such as header-portfolio.php, header-blog.php, header-gallery.php, etc.
Calling Alternate style.css files in WordPress
So, you have a
different header for various sections of your site, but the CSS is all
the same. Why not have a seperate CSS file for different areas of your
Again, this is done by simply replacing a single line of code.
Find this code (or something similar):
<style type=”text/css” media=”screen”><!–
@import url( <?php bloginfo(‘stylesheet_url’); ?> );
Replace it with this code:
<link rel=”stylesheet” href=”/wp-content/themes/imwp/style2.css” type=”text/css” media=”screen” />