Messing with sidebar ;)
By default my Misty Look sidebar consisted of boxes in following order:
About
Archive
Categories
Pages
Links
Meta.
I just ‘redecorated’ my site and now I have only 3 pages so I don’t need a list of them in sidebar.
That was simple -> I removed code corresponding to pages from sidebar.php.
Then I reordered boxes to have them like this:
About
Categories
Links
Archives
Meta.
That also wasn’t difficult.
Steps started when I decided I want to have all boxes on home page while on the other two only: Categories, Links, Archives.
About is set as default to show up on home page only.
To force Links to show on all pages I removed if(is_home()) from following line:
<?php if(is_home()) { mistylook_ShowLinks(); ?>
Ok. Links were on all pages but… Meta as well.
It took me a while to solve it and… taaadam ;) :
1. In functions.php I added – just under function mistylook_ShowLinks – new function:
function mistylook_ShowMetaBox() {?>
<li class="sidebox">
<h2>Meta</h2>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
<?php wp_meta(); ?>
</ul>
</li>
<?php }
2. In sidebar.php I replaced:
<li class="sidebox">
<h2><?php _e(’Meta’); ?></h2>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
<?php wp_meta(); ?>
</ul>
</li>
with
<?php if(is_home()) mistylook_ShowMetaBox(); ?>
And voila :).
17th June 2007 no comments yet




