Title: Multiple Sidebars
Last modified: August 21, 2016

---

# Multiple Sidebars

 *  [christhomas32](https://wordpress.org/support/users/christhomas32/)
 * (@christhomas32)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/multiple-sidebars-7/)
 * I am running into a “Call to undefined function” error when I try to instantiate
   two sidebars on my site.
 * the following code is my registration of both sidebars in my functions.php:
 * if ( function_exists(‘register_sidebar’) ) {
    register_sidebar(array( ‘name’ 
   => ‘main_sidebar’, ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’, ‘
   after_widget’ => ‘</div>’, ‘before_title’ => ‘<h2>’, ‘after_title’ => ‘</h2>’));
   register_sidebar(array( ‘name’ => ‘home_sidebar’, ‘before_widget’ => ‘<div id
   =”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ‘
   <h2>’, ‘after_title’ => ‘</h2>’ ));
 * I also have two corresponding PHP files with the following code (tailored to 
   each file):
 * <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘main_sidebar’)):?
   >
    <?php endif; ?>
 * Does anyone know why I am getting the fatal call to undefined function message?
 * Thanks,
    Chris

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/multiple-sidebars-7/#post-3650943)
 * > I am running into a “Call to undefined function” error
 * please post the full error message;
 * what function is undefined?
 *  Thread Starter [christhomas32](https://wordpress.org/support/users/christhomas32/)
 * (@christhomas32)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/multiple-sidebars-7/#post-3650966)
 * This is the full error message copied from the log:
 * [Fri Apr 12 11:14:52 2013] [error] [client ::1] PHP Fatal error: Call to undefined
   function get_main_sidebar() in C:\\wamp\\www\\OnlineArizonaHomes\\wordpress\\
   wp-content\\themes\\ArizonaHomes\\index.php on line 3, referer: [http://localhost/OnlineArizonaHomes/](http://localhost/OnlineArizonaHomes/)
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/multiple-sidebars-7/#post-3650979)
 * `get_main_sidebar()` is not a default WordPress function – if you or your theme
   has not defined this function somewhere, you’ll get the error message;
 * review:
 * [http://codex.wordpress.org/Function_Reference/get_sidebar](http://codex.wordpress.org/Function_Reference/get_sidebar)
 *  Thread Starter [christhomas32](https://wordpress.org/support/users/christhomas32/)
 * (@christhomas32)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/multiple-sidebars-7/#post-3650980)
 * Okay, easy fix. Just had to specify the specific sidebar in my call
 * <?php get_sidebar(‘main_sidebar’); ?>
 * Thank you for the help!

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

The topic ‘Multiple Sidebars’ is closed to new replies.

## Tags

 * [Call to undefined function:](https://wordpress.org/support/topic-tag/call-to-undefined-function/)
 * [custom theme](https://wordpress.org/support/topic-tag/custom-theme/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [christhomas32](https://wordpress.org/support/users/christhomas32/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/multiple-sidebars-7/#post-3650980)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
