Here we learn about how to register a sidebar and use it in your custom theme In WordPress.
Custom code copied and paste into your child theme’s functions.php file.
1. register_sidebar()
It has more parameters see below the code example.
<?php function myblog_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Footer Column 3', 'text-domain' ), 'id' => 'myblog-footer-col-3', 'description' => esc_html__( 'Add widgets here.', 'text-domain' ), 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'myblog_widgets_init' ); ?>
The following list of the code parameters.
2. dynamic_sidebar()
How to display the sidebar using the dynamic_sidebar function.
Add below code in the footer file:
<?php <div class="footer-bottom"> <div class="container"> <div class="footer3-sec"> <?php if ( is_active_sidebar( 'myblog-footer-col-3' ) ) : dynamic_sidebar( 'myblog-footer-col-3' ); endif; ?> </div> </div> </div> ?>
OUTPUT:
1) Set widget in the admin
2) footer display
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular