Skip to content

Instantly share code, notes, and snippets.

@mustafix
Last active May 10, 2019 20:52
Show Gist options
  • Save mustafix/df8117d58244adea5f73944cda9374d1 to your computer and use it in GitHub Desktop.
Save mustafix/df8117d58244adea5f73944cda9374d1 to your computer and use it in GitHub Desktop.
<!--- Register sidebars and widgetized areas ---->
<?php
function cerate_widget_areas() {
register_sidebar( array(
'name' => __( 'Welcome Message', 'brightpage' ),
'id' => 'footer_widget',
'description' => __( 'An optional widget area for your welcome message area.', 'brightpage' ),
'before_widget' => '<div class="col-lg-3"><div class="widget">',
'after_widget' => '</div></div>',
'before_title' => '<h5 class="widget-heading">', //'<h2 style="display:none">',
'after_title' => '</h5>',
)
);
}
add_action('widgets_init', 'cerate_widget_areas');
?>
<!--- main query ----->
<!--- without fall back data, just using this code----->
<?php dynamic_sidebar( 'footer_widget' ); ?>
<!--- with fall back data, just using this code ----->
<?php if ( ! dynamic_sidebar( 'welcome_message' ) ) : ?> <!-- register_sidebar id =welcome_message --->
your content
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment