Skip to main content

Ivan Teoh

Something personal yet public

WordPress Theme Development 6 - Theme Functions

The WordPress theme functions file, functions.php, basically acts like a plugin, adding more features to WordPress theme. Currently I added the code as following to this file for supporting widget in dynamic sidebar.

56-functions.php (Source)

<?php
/**
 * @package WordPress
 * @subpackage Your_Theme
 */
if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget' => '</li>',
        'before_title' => '',
        'after_title' => '',
    ));
?>

Comments

Comments powered by Disqus