Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*******Register WIDGET************/
- function create_widget( $name, $id, $description ) {
- register_sidebar(array(
- 'name' => __( $name ),
- 'id' => $id,
- 'description' => __( $description ),
- 'before_widget' => '<div class="widget">',
- 'after_widget' => '</div>',
- 'before_title' => '<h4>',
- 'after_title' => '</h4>'
- ));
- }
- create_widget( 'Front Page Left', 'front-left', 'Displays on the left of the homepage' );
- create_widget( 'Front Page Center', 'front-center', 'Displays in the center of the homepage' );
- create_widget( 'Front Page Right', 'front-right', 'Displays on the right of the homepage' );
- create_widget( 'Page Right', 'page-right', 'Displays on the right of the page' );
- create_widget( 'Blog Right', 'blog', 'Displays on the right of the blog page' );
- //Call the Sidebar
- <div class="col-md-3 page_widget">
- <?php if (!dynamic_sidebar('blog')):?>
- <h2>Widget Alert</h2>
- <p>Please add your widget from widger section</p>
- <?php endif;?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement