The Extra Column

I have always wondered how to get an extra column into wp. I normally just call the sidebar and footer from index.php as usual and then if I want a three column layout, put the two columns in the sidebar. e.g.

[/div][!-- end of id content--]
[/div][!--end of id wrapper--]
[!--index.php end--]

[!--include sidebar--]
[?php get_sidebar(); ?]
In the sidebar.php I have two divs, one called leftcol and float this left and the second say rightcol and float it right. (It is a little bit more complicated than that but for ease this is how I will leave it).

Now we finish the index.php by telling it to call the footer:
[!--include footer--]
[?php get_footer(); ?]

However, if I add this line after the call to the sidebar:
[!--include extra.php--]
[?php include (TEMPLATEPATH . '/extra.php'); ?]
Then I can add an extra column without resorting to having in sidebar.php.

Why is this important? Well maybe the opening page is a three column layout which upon opening a post goes to a two column structure. Using the above will help that process.

By the way I have changed the <> brackets for [] just so it doesn’t break the site.

Comments

Topics: Wordpress |