Title: Sidebar on Single.php
Last modified: August 22, 2016

---

# Sidebar on Single.php

 *  [siamesetween](https://wordpress.org/support/users/siamesetween/)
 * (@siamesetween)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/sidebar-on-singlephp-2/)
 * Can anyone help me put a sidebar on this page – [http://www.philrealty.ph/of-space-life-and-art/](http://www.philrealty.ph/of-space-life-and-art/)?
   It’s single.php. I cant make it work. Any help will greatly appreciated.
 *     ```
       <?php get_header(); ?>
   
       <?php 
   
       	global $ewf_theme_settings;
   
       	$page_blog = ewf_get_page_relatedID();
       	$page_blog_sidebar = ewf_get_sidebar_id( $ewf_theme_settings['blog']['sidebar'] , $page_blog);
       	$page_layout = ewf_get_sidebar_layout( $ewf_theme_settings['blog']['layout'], $page_blog );
   
       	// echo '<br/>### Page blog ID:'.$page_blog;
       	// echo '<br/>### Page Layout: '.$page_layout;
       	// echo '<br/>### Page Sidebar: '.$page_blog_sidebar;
   
       	switch ($page_layout) {
   
       		case "layout-sidebar-single-left":
       			echo '<div class="ewf-row">';
       				echo '<div class="ewf-span4">';
   
       					dynamic_sidebar($page_blog_sidebar);
   
       				echo '</div>';
       				echo '<div class="ewf-span8">';
   
       					if ( have_posts() ) while ( have_posts() ) : the_post();
       						get_template_part('templates/blog-item-default');
       					endwhile; 
   
       				echo '</div>';
       			echo '</div>';
       			break;
   
       		case "layout-sidebar-single-right":
       			echo '<div class="ewf-row">';
       				echo '<div class="ewf-span8">';
   
       					if ( have_posts() ) while ( have_posts() ) : the_post();
       						get_template_part('templates/blog-item-default');
       					endwhile; 
   
       				echo '</div>';
       				echo '<div class="ewf-span4">';
   
       					dynamic_sidebar($page_blog_sidebar);
   
       				echo '</div>';
       			echo '</div>';
       			break;
   
       		case "layout-full":
       			echo '<div class="ewf-row">';
       				echo '<div class="ewf-span12">';
   
       					if ( have_posts() ) while ( have_posts() ) : the_post();
       						get_template_part('templates/blog-item-default');
       					endwhile; 
   
       				echo '</div>';
       			echo '</div>';
       			break;
   
       	}
   
       ?>
   
       <?php get_footer(); ?>
       ```
   
 * I want similar to this: [http://www.philrealty.ph/page-with-sidebar/](http://www.philrealty.ph/page-with-sidebar/)
   but this one was made from Pages not php
 * Thanks in advance!

Viewing 1 replies (of 1 total)

 *  [CMSHelpLive](https://wordpress.org/support/users/cmshelplivecom/)
 * (@cmshelplivecom)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/sidebar-on-singlephp-2/#post-5246503)
 * <?php get_sidebar(); ?>
 * add this line before calling get_footer function in single.php file. And relatively
   reduce the area for content part so that there will be space for sidebar.

Viewing 1 replies (of 1 total)

The topic ‘Sidebar on Single.php’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [CMSHelpLive](https://wordpress.org/support/users/cmshelplivecom/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/sidebar-on-singlephp-2/#post-5246503)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
