wordpress - register a sidebar in function.php


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /* register sidebars */
  2. if ( function_exists('register_sidebar') ){
  3. register_sidebar(array('name' => 'Sidebar',
  4. 'before_widget' => '<li class=wpSidebar >',
  5. 'after_widget' => '</li>',
  6. 'before_title' => '<h3>',
  7. 'after_title' => '</h3>',
  8. ));
  9. register_sidebar(array('name' => 'Footer',
  10. 'before_widget' => '<li class=wpFooterSidebar >',
  11. 'after_widget' => '</li>',
  12. 'before_title' => '<h3>',
  13. 'after_title' => '</h3>',
  14. ));
  15.  
  16. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.