My Press-Telegram ID back when I was their Content Manager until a round of layoffs in 2009.
Fun fact: LA.com cost the newsgroup a lot of money and nothing ever came of it except this useless box of business cards. The website was supposed to be the lifestyle and entertainment destination for the region.
Registering a sidebar gives our theme an area where dynamic content can be added by Widgets and managed by the site owner using a drag an drop interface. This can include menus, custom HTML, Images and additional features introduced by Plugins.
In this post we’ll register a sidebar, that will then be assigned dynamic widgets and displayed on our site’s footer.
functions.php
Registering a sidebar adds the Widgets option to our Appearance menu which didn’t appear previously. By registering a sidebar we also enable this feature in the WordPress dashboard.
WordPress Dashboard > Appearance > WidgetsRegister a Sidebar in functions.php
// Register a Sidebar
register_sidebar(
array(
'id' => 'footer',
'name' => __( 'Footer', 'textdomain' ),
'description' => __( 'Displays in the footer on the left side', 'textdomain'),
)
);
Once we’ve registered the sidebar we can assign content to our Footer widget.
Assigning Categories and Pages to the Footer widget
footer.php
Next we’ll want to display that sidebar so we’ll use the conditional tagis_active_sidebar() to check if any widgets have been assigned. If that check passes WordPress will display the widgets. By running a check such as this we prevent WordPress from adding empty HTMLtags to the page. This also helps us with accessibility later.