
Untitled
By:
Viper007Bond on
Aug 4th, 2011 | syntax:
PHP | size: 0.57 KB | hits: 97 | expires: Never
<?php
function get_sidebar( $name = null, $subfolder = null ) {
do_action( 'get_sidebar', $name );
$templates = array();
if ( ! empty( $subfolder ) ) {
if ( isset( $name ) )
$templates[] = "$subfolder/sidebar-{$name}.php";
$templates[] = "$subfolder/sidebar.php";
}
if ( isset( $name ) )
$templates[] = "sidebar-{$name}.php";
$templates[] = 'sidebar.php';
// Backward compat code will be removed in a future release
if ('' == locate_template($templates, true))
load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php');
}
?>