Last active
November 11, 2022 10:35
-
-
Save humayunahmed8/e24a20a42bd6e7d81abae2beb41b29c0 to your computer and use it in GitHub Desktop.
Register sidebar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Register widget area. | |
* | |
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar | |
*/ | |
function stock_humayunbd_widgets_init() { | |
register_sidebar( array( | |
'name' => esc_html__( 'Footer Widget', 'stock-humayunbd' ), | |
'id' => 'stock_footer', | |
'description' => esc_html__( 'Add Footer widgets here.', 'stock-humayunbd' ), | |
'before_widget' => '<div class="col-md-3 col-sm-6"><div id="%1$s" class="widget %2$s">', | |
'after_widget' => '</div></div>', | |
'before_title' => '<h4 class="widget-title">', | |
'after_title' => '</h4>', | |
) ); | |
} | |
add_action( 'widgets_init', 'stock_humayunbd_widgets_init' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// widget callbacks. | |
if(is_active_sidebar('stock_footer')) : ?> | |
<div class="row"> | |
<?php dynamic_sidebar('stock_footer'); ?> | |
</div> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment