Wordpress: Custom Widget Area


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

A custom widget area for wordpress.


Copy this code and paste it in your HTML
  1. PLACE WHERE YOU WANT WIDGET AREA TO GO
  2.  
  3. <?php
  4. if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('AREA_NAME') ) : ?>
  5. <?php endif; ?>
  6.  
  7.  
  8.  
  9.  
  10. PLACE IN FUNCTIONS.PHP
  11.  
  12. register_sidebar( array(
  13. 'name' => __( 'Area Display Name'),
  14. 'id' => 'AREA_NAME',
  15. 'description' => __( 'Area Description'),
  16. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
  17. 'after_widget' => "</li>",
  18. 'before_title' => '<h3 class="widget-title">',
  19. 'after_title' => '</h3>',
  20. ) );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.