Adding a sidebar to Blix Pages
February 9th, 2006
This theme you see here, Blix, doesnt have the sidebar shown by default on pages. This doesn’t suit me, as I need the navigation that lives in the sidebar for my pages. Blix is setup for a few pages which automagically appear in the horizontal menu under the header graphic - fine for some, but I will end up with 20-30 pages in several levels.
Since I couldnt find a great deal of help from the wordpress codex / forums etc, I thought I would write the process down here for posterity.
2 Things need changing to add a sidebar to the blix pages -
1.) Header Template
change the following line
<body><div id="container"< ?php if (is_page() && !is_page("archives")) echo " class=\"singlecol\""; ?>></div></body>
You want to add a # in front of the if statement to stop it executing -
<body><div id="container"< ?php # if (is_page() && !is_page("archives")) echo " class=\"singlecol\""; ?>></div></body>
This prevents the content div getting the class “singlecol” which is normally used to expand the main content div to take up all the available space, which would leave no room for the sidebar and break the layout.
2.) Pages Template
At the bottom of this file:
<!-- /content -->
< ?php get_footer(); ?>
Add the get sidebar code:
<!-- /content -->
< ?php get_sidebar(); ?>
< ?php get_footer(); ?>
At the most basic level thats it - you should have a sidebar on your pages. Right now it will be a little empty, as many of the sidebar features are inside if statements that only show on certain types of pages. You can either edit these or put seperate if statements to format the sidebar just for dispay on pages - its up to you.
Entry Filed under: Development
3 Comments Add your own
1. sekano | December 22nd, 2006 at 3:24 pm
Hy, i do the changes but i haven´t sidebar on pages.
Then i have changed:
>
by the symple code:
but i haven´t sidebar on pages yet.
2. juval porat | March 28th, 2007 at 10:53 am
thank you very much. this was very helpful!
3. Mimi | April 23rd, 2008 at 5:01 am
I know this is an old post and you might not see this but.. I love you for this…! I have been searching for an hour on how to do this to no avail! ALAS, I found the one simple character I was missing (#) and it is fixed! THANK YOU!!!!!!!!!!
Leave a Comment
Akismet has protected Mark Crostons Blog from 38,678 spam comments.. Spamming is a waste of Your time. All comments from first time posters are held for moderation, and will show up on the site within 24 hours.
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed