Forums

[resolved] How does dynamic_sidebar() knows what style to use? (2 posts)

  1. extrakun
    Member
    Posted 3 years ago #

    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?

  2. Otto
    Tech Ninja
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags