Support » Themes and Templates » How does dynamic_sidebar() knows what style to use?

  • Resolved extrakun

    (@extrakun)


    Out of curiosity, I have been looking at the sidebar.php of my template (modern notepad):

    <div id="right-block">
        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
            <div class="box categories">
            	<div class="header">
    	        	<h3><?php _e('Category:'); ?></h3>
    	        </div>
            	<ul>
            	    <?php wp_list_cats('sort_column=name&hierarchical=1'); ?>
            	</ul>
            </div>
           	...snipped...
    </div><!--#right-block-->

    I understand that dynamic_sidebar() renders the widgets; what is puzzling to me is how does dynamic_sidebar() knows what style to use? Each of the widget is using the .box class for each div.

    How does this happens?

Viewing 1 replies (of 1 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Stuff like that is defined in the theme’s functions.php file, where it initially creates the sidebars.

Viewing 1 replies (of 1 total)
  • The topic ‘How does dynamic_sidebar() knows what style to use?’ is closed to new replies.