Created
September 29, 2016 04:21
-
-
Save misterebs/acb15934f220ffbcc193e65484feb995 to your computer and use it in GitHub Desktop.
Dynamic multiple widget area
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
// Custom Widget Area | |
if (function_exists('register_sidebar')) { | |
register_sidebar(array( | |
'name' => 'Sidebar 1', | |
'id' => 'sidebar1', | |
'description' => 'This is the widgetized sidebar1', | |
'before_widget' => '<div id="%1$s" class="widget-container %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h1>', | |
'after_title' => '</h1>' | |
)); | |
register_sidebar(array( | |
'name' => 'Sidebar 2', | |
'id' => 'sidebar2', | |
'description' => 'This is the widgetized sidebar2.', | |
'before_widget' => '<div id="%1$s" class="widget-container %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3>', | |
'after_title' => '</h3>' | |
)); | |
} | |
Insert this code in loop to control of display | |
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('team1')) : else : ?> | |
<?php endif; ?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment