Title: get_sidebar() question
Last modified: August 18, 2016

---

# get_sidebar() question

 *  [rustindy](https://wordpress.org/support/users/rustindy/)
 * (@rustindy)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/)
 * Can `get_sidebar()` be called more than once from a file? It seems to only work
   the first time and be completely ignored the second time it’s called. Do I need
   to add another command before the second call?

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/get_sidebar-question/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/get_sidebar-question/page/2/?output_format=md)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193869)
 * Apparently the internal `get_template()` function (which is what the various 
   get_* tags use) performs some protection against loading a template multiple 
   times. To get around this use `include()` to load the sidebar the second time,
   like this:
 * `<?php include( TEMPLATEPATH . '/sidebar.php'); ?>`
 * (And no, I won’t ask why you need to include the sidebar twice…)
 *  Thread Starter [rustindy](https://wordpress.org/support/users/rustindy/)
 * (@rustindy)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193873)
 * Thanks, I’ll give that a shot.
 * (I’m making a theme – needs two sidebars with different content, but it seemed
   like a good idea to keep all of it in one `sidebar.php` file so it would be easy
   to find.)
 *  [neon](https://wordpress.org/support/users/neon/)
 * (@neon)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193876)
 * Two sidebars with different content? Sounds more like a three column theme.
 *  Thread Starter [rustindy](https://wordpress.org/support/users/rustindy/)
 * (@rustindy)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193889)
 * You would be partially correct sir! Actually, this particular site template is
   looking like a cross between [http://www.ifelse.co.uk/](http://www.ifelse.co.uk/)
   and [http://www.wp-blogger.com/blog/](http://www.wp-blogger.com/blog/) (or [http://www.atthe404.com](http://www.atthe404.com)).
   So it’ll be a 3-2 column theme in the end.
 *  [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193919)
 * Splitting the templates up for 3 columns is tricky because they need to be amalgamated
   back again for two columns. Mine is using a very ugly bit of engineering. (Dont
   ask ) 🙂 But I would not think that calling the same one twice is going to be
   the best way forward. My 2 cents. Good luck. These 3/2 cols rock 🙂
 *  [neon](https://wordpress.org/support/users/neon/)
 * (@neon)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193929)
 * Ah, I see, I guess this will not be as simple as get_sidebarA, get_sidebarB, 
   etc. Good luck with and thank you for your valiant efforts. 🙂
 *  [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193930)
 * get_sidebarC might do it. Two for 3 cols, One for 2 cols.
 *  [neon](https://wordpress.org/support/users/neon/)
 * (@neon)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193931)
 * … and if the same sidebar had to be called twice, it could be as simple as sidebarA
   =sidebarC.
 *  [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193932)
 * I think I am right in saying that get_ can only be used for a WP approved template
   name. The self made ones need include or require.
 *  [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193934)
 * Superficially this appears easy by using a php conditional in sidebar. Is home
   etc.
    BUT. There is a lot of additional markup that needs to be generated for
   3 cols – clearer divs etc. That is where it is difficult to do it elegantly.
 *  [ifelse](https://wordpress.org/support/users/ifelse/)
 * (@ifelse)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193937)
 * Word of advice: Design your 3 column and 2 column markup first thinking carefully
   about how to elegently move from one to the other. Only when you’re comfortable
   with the markup should you start work on the php/wp tags.
 * Work from outside in.
 *  [neon](https://wordpress.org/support/users/neon/)
 * (@neon)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-193943)
 * See, that is why you people are the experts and I just have fun reading, dissecting
   and learning. 🙂
 *  Thread Starter [rustindy](https://wordpress.org/support/users/rustindy/)
 * (@rustindy)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-194056)
 * The way the site is laid out (or planned to be, more accurately) is so that the
   front page will be two columns for the duration of the latest post (shown in 
   full), and then 3 columns underneath to show a couple of certain categories of
   links and excerpts from the most recent posts. Pretty much every other page will
   be 2 columns, lacking the two `div`s that make up the two columns at the bottom
   of the page.
 * [http://www.digitalrights.ca](http://www.digitalrights.ca) is the address of 
   the site. It’s in a VERY early stage right now, and ugly as hell, but it works(
   except that there is currently *only* the 2/3 column template, no 2 column pages
   yet). The CSS is very unorganized, and I did have to make a single concession
   to IE 5.x’s 3-pixel-jog bug, but it is otherwise entirely hack free.
 * Please feel free to let me know if I’m on the right track with this 🙂
 *  Thread Starter [rustindy](https://wordpress.org/support/users/rustindy/)
 * (@rustindy)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-194069)
 * Oh, it works in IE 4, 5, 5.5, and 6, and Firefox (so presumably all recent Gecko
   browsers). I haven’t tested Opera, and have no access right now to Linux or Mac
   boxes to test it on. The only existing issue that kills me is that the site isn’t
   centered in IE 4 or 5.x.
 *  [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/#post-194071)
 * text-align: center in the body will center it in IE. Set text-align back to left
   in your wrapper to get straight again. The 3 px jog is caused by two floats going
   in the same direction if you float left and right it can be avoided (as can the
   hack).I can see enough of the blog to see how its going to be set up. Looks a
   cool template.

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/get_sidebar-question/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/get_sidebar-question/page/2/?output_format=md)

The topic ‘get_sidebar() question’ is closed to new replies.

 * 19 replies
 * 5 participants
 * Last reply from: [Root](https://wordpress.org/support/users/root/)
 * Last activity: [21 years ago](https://wordpress.org/support/topic/get_sidebar-question/page/2/#post-194131)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
