Title: Header widget area
Last modified: August 22, 2016

---

# Header widget area

 *  [enjoyordie](https://wordpress.org/support/users/enjoyordie/)
 * (@enjoyordie)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/header-widget-area/)
 * Hi!
 * I need help adding a header widget area in my website.
 * I relly don’t get why theme designers don’t do that automatically, I mean every
   website that is multilingual needs to have flags or language menu on the top…
   It is really frustrating.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/header-widget-area/#post-5312390)
 * [http://codex.wordpress.org/Widgetizing_Themes](http://codex.wordpress.org/Widgetizing_Themes)
 * details depend on your currently used theme.
    [http://codex.wordpress.org/Forum_Welcome#Include_as_much_information_as_possible](http://codex.wordpress.org/Forum_Welcome#Include_as_much_information_as_possible)
 *  [badsprad](https://wordpress.org/support/users/badsprad/)
 * (@badsprad)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/header-widget-area/#post-5312426)
 * Hi enjoride.
 * I went through a similar issue with my theme. The above links from alchymyth 
   are a great start and help you follow the proper WordPress technique of implementing
   a sidebar.
 * To assist you further with some steps – follow the bellow:
 * 1) Register the sidebar in your functions.php
    -as per alchymyth’s link [http://codex.wordpress.org/Widgetizing_Themes](http://codex.wordpress.org/Widgetizing_Themes)
 * If your theme has at least one sidebar already (registered correctly), then you’ll
   see that the php code in this link will look similar to it – add it underneath
   that area. If not, copy paste the php exactly in this link at the bottom of your
   functions.php file.
 * 2) Create a sidebar template
    In the same directory of your theme’s functions.
   php file, create a new file – like ‘sidebar-header.php’
 * This is where the actual HTML is stored, that creates your widget. In the last
   step (3) you’ll see why you need this file.
 * As an example, mine looks like this:
 *     ```
       <?php if ( is_active_sidebar( 'header-area' ) ) : ?>
       	<div id="sidebar-secondary" class="sidebar">
       		<?php dynamic_sidebar( 'header-area' ); ?>
       	</div>
       <?php endif; ?>
       ```
   
 * * the ‘header-area’ is my widget ID and is needs to be the same as in your functions.
   php file, where you registered the widget. See field ‘ID’ in the Widgetizing_Themes
   link earlier.
 * 3) Reference your widget on a page:
    This is the easy part now. And, you can 
   do this on any page type. As an example, I call my sidebar in my header.php file(
   as it’s a header widget / above page content, etc.).
 * So go into your header.php file, locate where you want to call the sidebar, and
   insert something like this:
 *     ```
       <?php get_sidebar('header'); ?>
       ```
   
 * * note: that the get sidebar method works like this:
    Your sidebar file name 
   = sidebar-header.php The ‘get_sideabr’ part = header
 * It didn’t first make sense to me, but WordPress looks for files that are prefixed
   with ‘sidebar-‘
 * Lastly, if you’re looking for some more tips, this guide by Justin Tadlock is
   really helpful: [http://justintadlock.com/archives/2010/11/08/sidebars-in-wordpress](http://justintadlock.com/archives/2010/11/08/sidebars-in-wordpress)
 * Good luck 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Header widget area’ is closed to new replies.

 * 2 replies
 * 3 participants
 * Last reply from: [badsprad](https://wordpress.org/support/users/badsprad/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/header-widget-area/#post-5312426)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
