I've been looking at Twenty Thirteen's code structure and thought I could learn a thing or two about theme development.

There's something that I haven't found an answer to:

Twenty Thirteen's widget areas are called by just using get_sidebar(). However, there are 2 sidebar files in the theme's folder - sidebar-main.php, sidebar.php.

From what I understand, sidebar-main.php can be called by defining the parameter of get_sidebar('main'). In Twenty Thirteen's case, I see no code which calls that, yet is_active_sidebar('sidebar-1') is executed.

How does it call sidebar-main.php without defining the parameter?

Another thing I've tried doing is switching the file names. The one with 'sidebar-2' to sidebar-main.php and 'sidebar-1' to sidebar.php. Everything screws up! The right sidebar widget isn't in place and the footer widget doesn't even show.

enter image description here

How is Twenty Thirteen calling it's sidebars?

Thanks in advance.

  • Have you looked into footer.php? – birgire Nov 25 '13 at 11:55
  • Omg! I can't believe I missed that! – Bobby Nov 25 '13 at 12:07

Here is a list of all the get_sidebar() calls from the TwentyThirteen files:

  • taxonomy-post_format.php: <?php get_sidebar(); ?>
  • search.php: <?php get_sidebar(); ?>
  • single.php: <?php get_sidebar(); ?>
  • archive.php: <?php get_sidebar(); ?>
  • index.php: <?php get_sidebar(); ?>
  • page.php: <?php get_sidebar(); ?>
  • tag.php: <?php get_sidebar(); ?>
  • category.php:<?php get_sidebar(); ?>
  • author.php: <?php get_sidebar(); ?>


  • footer.php: <?php get_sidebar( 'main' ); ?>

Hope this helps ...

| improve this answer | |
  • I think I need to stop and get some rest now. Sorry for this redundant question. – Bobby Nov 25 '13 at 12:07
  • No problem, it happens to me all the time ... ;-) – birgire Nov 25 '13 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.