Ashley Cameron Design

Ashley Cameron Design

Dynamic Sidebar

SnippetsWordPress

About a 1 minute read

"Life is like riding a bicycle. To keep your balance, you must keep moving."

Albert Einstein


1
2
3
4
5
6
7
8
9
10
11
12
13
<?php //add in theme file
    if(!function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar') ) : ?>
<?php endif; ?>

<?php //add in functions.php
    if (function_exists('register_sidebar') )
    register_sidebar(array(
        'before_widget' => '<div class="widget">',
        'after_widget' => '</div>',
        'before_title' => '<h2>',
        'after_title' => '</h2>',
    ));
?>