Title: sidebar.php
Last modified: August 20, 2016

---

# sidebar.php

 *  Resolved [Linards](https://wordpress.org/support/users/linards/)
 * (@linards)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/)
 * Hi,
 * Im trying to create a theme from scratch, but have one small problem. in index.
   php file I have `<?php get_header();?> <?php get_sidebar();?> <?php get_footer();?
   >`
 * but I dont have any sidebar.php file in my theme yet, anyhow it renders with 
   ARCHIVES, CATEGORIES and META sections in my theme, but I dont need it yet. When
   I remove `<?php get_sidebar();?>` it is all fine. Can anyone tell me from where
   it gets the file to display in y theme? Im creating it on my **localhost**
 * Many thanks

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

 *  [@mercime](https://wordpress.org/support/users/mercime/)
 * (@mercime)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593026)
 * >  Can anyone tell me from where it gets the file to display in y theme?
 * <?php get_sidebar();?> gets sidebar.php
 *  Thread Starter [Linards](https://wordpress.org/support/users/linards/)
 * (@linards)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593035)
 * Thanks,
 * Its’s interesting, because I don’t have sidebar.php in my theme file structure.
   I tried deleting the default themes too, and see what happens, still the same.
   I really don’t know from where it pulls it.
 *  [@mercime](https://wordpress.org/support/users/mercime/)
 * (@mercime)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593036)
 * What theme are you using?
 *  [detaatsilado](https://wordpress.org/support/users/detaatsilado/)
 * (@detaatsilado)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593038)
 * help me too icant open login to my site like this ‘Parse error: syntax error,
   
   unexpected ‘<‘ in /home/ u143892164/public_html/ wp-content/themes/ home_dealing6/
   library/ sidebars.php on line 204′
 *  [@mercime](https://wordpress.org/support/users/mercime/)
 * (@mercime)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593039)
 * detaatsilado I would change theme to Twenty Twelve theme. If that doesn’t work,
   please start a new topic.
 *  Thread Starter [Linards](https://wordpress.org/support/users/linards/)
 * (@linards)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593040)
 * Thanks [@mercime](https://wordpress.org/support/users/mercime/),
 * Im using blank theme from scratch, it’s completely stripped, and im just adding
   my styles and markup.
 * Cheers
 *  Thread Starter [Linards](https://wordpress.org/support/users/linards/)
 * (@linards)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593042)
 * There is no sidebar.php file I can edit, but it displays with the GET request
   anyway.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593052)
 * WordPress loads a default template from from _**/wp-inludes/theme-compat/sidebar.
   php**_
 * this is the core code, from _**/wp-includes/general-template.php**_, behind `
   get_sidebar()`:
 *     ```
       function get_sidebar( $name = null ) {
         83      do_action( 'get_sidebar', $name );
         84
         85      $templates = array();
         86      if ( isset($name) )
         87          $templates[] = "sidebar-{$name}.php";
         88
         89      $templates[] = 'sidebar.php';
         90
         91      // Backward compat code will be removed in a future release
         92      if ('' == locate_template($templates, true))
         93          load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php');
         94  }
       ```
   
 *  Thread Starter [Linards](https://wordpress.org/support/users/linards/)
 * (@linards)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593053)
 * Thank you alchymyth,
 * Will try your way straight away after work. So could I just change the last `
   if` statement to `false`? Sorry about the dumb question.
 * Many Thanks
 *  [@mercime](https://wordpress.org/support/users/mercime/)
 * (@mercime)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593055)
 * [@linards](https://wordpress.org/support/users/linards/) you should not be changing
   core files which alchyyth referred to above.
 * Going back to your original post:
 * > but I dont have any sidebar.php file in my theme yet, anyhow it renders with
   > ARCHIVES, CATEGORIES and META sections in my theme, but I dont need it yet.
 * What exactly do you want to do?
 *  Thread Starter [Linards](https://wordpress.org/support/users/linards/)
 * (@linards)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593056)
 * Thank you [@mercime](https://wordpress.org/support/users/mercime/),
 * Im new to PHP, I want to edit(if necessary) the `sidebar.php` file in my blank
   theme file directory, but how the `sidebar.php` is loaded in my theme from default
   theme path **_/wp-inludes/theme-compat/sidebar.php_** which alchymyth so kindly
   explained to me.
 * Thanks for taking time to investigate
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593059)
 * > Will try your way straight away after work. So could I just change the last
   > if statement to false? Sorry about the dumb question.
 * that was no suggestion to change anything; it was just an explanation why a sidebar
   shows even if you don’t have the template in your theme.
 * _**general caveat: do not edit core files**_
 * unless you have _sidebar.php _in your theme, do not use the `<?php get_sidebar();?
   >` in your theme’s templates.
 * > I want to edit(if necessary) the sidebar.php file in my blank theme file directory
 * create a sidebar.php template file in your theme; and add the necessary code;
   
   if you don’t want any output just yet, add only `<?php return; ?>` into sidebar.
   php
 * [http://codex.wordpress.org/Function_Reference/dynamic_sidebar](http://codex.wordpress.org/Function_Reference/dynamic_sidebar)
 * [http://codex.wordpress.org/Widgetizing_Themes](http://codex.wordpress.org/Widgetizing_Themes)
 *  Thread Starter [Linards](https://wordpress.org/support/users/linards/)
 * (@linards)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593060)
 * Dear alchymyth,
 * thank you for your thorough explanation, caveat taken on-board.
    This is more
   than I expected.
 * Cheers
 *  [wandakatja](https://wordpress.org/support/users/wandakatja/)
 * (@wandakatja)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593235)
 * I’m totally new to WP and any website building. Just teaching myself from forums
   and YouTube videos and going very slow.
 * I’m using Imbalance 2 theme, and have a few questions:
 * 1) How do I delete the Search field in the upper right corner. One forum said
   to find the “sidebar.php” and delete from there, but I don’t have one.
 * 2) Also, I don’t seem to have a widgets section. What’s up with that and how 
   do I fix that?
 * 3) I’m using the 4 column layout and would like to have the big left-hand header
   be 2 columns wide, so it doesn’t wrap my main web title onto two lines. How?
 * Thank you in advance for your help!
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593236)
 * [@wandakatja](https://wordpress.org/support/users/wandakatja/)
 * please start your own topic.
 * [http://codex.wordpress.org/Forum_Welcome#Where_To_Post](http://codex.wordpress.org/Forum_Welcome#Where_To_Post)

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

The topic ‘sidebar.php’ is closed to new replies.

## Tags

 * [Blank](https://wordpress.org/support/topic-tag/blank/)
 * [problem](https://wordpress.org/support/topic-tag/problem/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)

 * 15 replies
 * 5 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/sidebarphp-6/#post-3593236)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
