Posted By

Ben on 07/21/09


Tagged

php wordpress


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

xmartyxcorex


Wordpress sidebar script for the function.php file


 / Published in: PHP
 

Standard script to create sidebar in Wordpress

  1. <?php
  2. if ( function_exists('register_sidebar') )
  3. register_sidebar(array(
  4. 'name' => 'Right Sidebar',
  5. 'before_widget' => '<div class="mywidgets>',
  6. 'after_widget' => '</div>',
  7. 'before_title' => '<h2>',
  8. 'after_title' => '</h2>',
  9. ));
  10. ?>
  11.  
  12. And in the Sidebar.php call the above with
  13.  
  14. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Right Sidebar") ) : ?>
  15. <?php endif; ?>

Report this snippet  

You need to login to post a comment.