WordPress Sidebars

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • register_sidebar( $args )
  • get_sidebar(string $name = null)

Parameters

ParameterDetails
$args(string | array) (Optional) Builds sidebar based on the name and id vvalues
$name*(string) (Optional) The name of the specialised sidebar. Default value: null

Remarks

Argument options are:

  • name - Sidebar name (default: localized 'Sidebar' and numeric ID).
  • id - Sidebar id - Must be all in lowercase, with no spaces (default: a numeric auto-incremented ID). If you do not set the id argument value, you will get E_USER_NOTICE messages in debug mode, starting with version 4.2.
  • description - Text description of what/where the sidebar is. Shown on widget management screen. (Since 2.9) (default: empty)
  • class - CSS class to assign to the Sidebar in the Appearance -> Widget admin page. This class will only appear in the source of the WordPress Widget admin page. It will not be included in the front end of your website. Note: The value sidebar will be prepended to the class value. For example, a class of tal will result in a class value of sidebar-tal. (default: empty).
  • before_widget - HTML to place before every widget (default: <li id="%1$s" class="widget %2$s">) Note: uses sprintf for variable substitution
  • after_widget - HTML to place after every widget (default: </li>\n).
  • before_title - HTML to place before every title (default: <h2 class="widgettitle">).
  • after_title - HTML to place after every title (default: </h2>\n).


Got any WordPress Question?