Widgetizing WP Themes


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

Add First part to Functions.php

Add Second to where you want a smillcrobe


Copy this code and paste it in your HTML
  1. <?php
  2. /**
  3.  * Register our sidebars and widgetized areas.
  4.  *
  5.  */
  6. function arphabet_widgets_init() {
  7.  
  8. register_sidebar( array(
  9. 'name' => 'Home right sidebar',
  10. 'id' => 'home_right_1',
  11. 'before_widget' => '<div>',
  12. 'after_widget' => '</div>',
  13. 'before_title' => '<h2 class="rounded">',
  14. 'after_title' => '</h2>',
  15. ) );
  16. }
  17. add_action( 'widgets_init', 'arphabet_widgets_init' );
  18. ?>
  19.  
  20.  
  21.  
  22.  
  23. <?php
  24. if ( dynamic_sidebar('home_right_1') ) :
  25. else :
  26. ?>
  27. <?php endif; ?>

URL: http://codex.wordpress.org/Widgetizing_Themes

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.