I'm a Java programmer, but knows PHP as well. Now I'm trying to enhance my skills in PHP and Wordpress. I had created a wordpress theme recently and now I'm trying to register my sidebar to make it widget ready. I'm following some tutorials(registering sidebar), but it seems that it is not clear to me how will I do it in my case. I just don't know what will I put on the following stuff.
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => '',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
?>
and here is my current sidebar
<div id="primary-sidebar">
<a href="?"><img src="<?php bloginfo('template_directory'); ?>/images/logo.jpg" alt="Company Logo" class="logo" /></a>
<ul class="menu">
<li><a href="?" <?php echo ($page == NULL) ? 'class="active"': '';?>>Home</a></li>
<li><a href="?page=philosophy" <?php echo ($page == 'philosophy') ? 'class="active"': '';?>>Philosophy</a></li>
<li><a href="?page=investments" <?php echo ($page == 'investments') ? 'class="active"': '';?>>Investments</a></li>
<li>
<a href="?page=about" <?php echo ($page == 'about') ? '': '';?>>About Us</a>
<ul>
<li><a href="?page=team" <?php echo ($page == 'team') ? 'class="active"': '';?>>Our Team</a></li>
<li><a href="?page=company" <?php echo ($page == 'company') ? '': '';?>>Company Profile</a></li>
</ul>
</li>
<li><a href="?page=contact" <?php echo ($page == 'contact') ? 'class="active"': '';?>>Contact Us</a></li>
</ul> <!-- END OF MENU -->
</div> <!-- END OF PRIMARY SIDEBAR -->
Can you help me with this, mates? Any help and comments/suggestions will be greatly appreciated. Thank you so much.
Create a functions.php
file (if you haven't done so already) and add this code:
<?php
function register_sidebar() {
register_sidebar(array(
'name' => '',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
}
add_action('init', 'register_sidebar');
?>