Advertisement
firoze

widget

Dec 19th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. // widget
  2.  
  3. function legacy_widget_areas() {
  4.     register_sidebar( array(
  5.         'name' => __( 'Image Add Widgets Area', 'legacy' ),
  6.         'id' => 'image_add', // Here (image_add) is id
  7.         'before_widget' => '<div class="single_sidebar">',
  8.         'after_widget' => '</div>',
  9.         'before_title' => '<h2>',
  10.         'after_title' => '</h2>',
  11.     ) );
  12.     // add another widget sidebar
  13.  
  14. }
  15. add_action('widgets_init', 'legacy_widget_areas');
  16.  
  17. // After creating a widget we have to the below code our location
  18. /*
  19.  
  20. <?php if ( ! dynamic_sidebar( 'image_add' ) ) : ?>    // Here (image_add) is id
  21.     // if needed then we can also more show data here
  22. <?php endif; ?>
  23.  
  24.  
  25. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement