get_sidebar

Advertisement

Summery Summery

Load sidebar template.

Syntax Syntax

get_sidebar( string $name = null )

Description Description

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".

Parameters Parameters

$name

(string) (Optional) The name of the specialised sidebar.

Default value: null

Source Source

File: wp-includes/general-template.php

	if ( ! locate_template( $templates, true, true, $args ) ) {
		return false;
	}
}

/**
 * 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".
 *
 * @since 1.5.0
 * @since 5.5.0 A return value was added.
 * @since 5.5.0 The `$args` parameter was added.
 *
 * @param string $name The name of the specialised sidebar.
 * @param array  $args Optional. Additional arguments passed to the sidebar template.
 *                     Default empty array.

Advertisement

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.