Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_sidebar [ WordPress Function ]

get_sidebar ( $name = null )
Parameters:
  • (string) $name The name of the specialised sidebar.
Uses:
Defined at:



Load sidebar template.

Includes the sidebar template for a theme or if a name is specified then a specialised sidebar will be included.

For the parameter, if the file is called "sidebar-special.php" then specify "special".

Source


<?php
function get_sidebar$name null ) {
    
do_action'get_sidebar'$name );

    
$templates = array();
    if ( isset(
$name) )
        
$templates[] = "sidebar-{$name}.php";

    
$templates[] = 'sidebar.php';

    
// Backward compat code will be removed in a future release
    
if ('' == locate_template($templatestrue))
        
load_templateABSPATH WPINC '/theme-compat/sidebar.php');
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics