Posted By

daprela on 06/25/14


Tagged

sidebar


Versions (?)

Register a new sidebar


 / Published in: PHP
 

This code must be added to functions.php in the child theme

  1. <?php
  2.  
  3. function my_sidebar() {
  4. register_sidebar( array(
  5. 'name' => __( 'Sidebar', 'theme' ),
  6. 'id' => 'widget-1',
  7. 'description' => 'This is a sidebar',
  8. 'class' => 'content',
  9. 'before_widget' => '<div id="widget-1" class="widget widget-1">',
  10. 'after_widget' => "</div></div>",
  11. 'before_title' => '<div class="widget-title">',
  12. 'after_title' => '</div><div class="widget-content">',
  13. ) );
  14. }
  15. add_action( 'widgets_init', 'my_sidebar' );

Report this snippet  

You need to login to post a comment.