Title: Sidebar single post php code
Last modified: August 21, 2016

---

# Sidebar single post php code

 *  [Andy8919](https://wordpress.org/support/users/andy8919/)
 * (@andy8919)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/sidebar-single-post-php-code-help/)
 * Hi, I’ve never written code before but read a few posts and am trying to get 
   the sidebar to appear in single post pages. Here’s the code that was in the single.
   php before I changed it:
 *     ```
       <?php
   
       /*
        * The Template for displaying all single posts.
        *
        * lambda framework v 1.0
        * by www.unitedthemes.com
        * since lambda framework v 1.0
        */
   
       global $lambda_meta_data;
       $meta_sidebar = $lambda_meta_data->get_the_value('sidebar');
   
       get_header();
       if($meta_sidebar != UT_THEME_INITIAL.'sidebar_none') {
       	st_before_content($columns='');
   
       } elseif($meta_sidebar == UT_THEME_INITIAL.'sidebar_none') {
   
       	st_before_content($columns='sixteen');
   
       }
   
       get_template_part( 'loop', 'single' );
       st_after_content();
       if($meta_sidebar) {
       	get_sidebar();
       } 
   
       get_footer();
       ?>
       ```
   
 * And here is what I changed it to. Notice I removed “_none”
 *     ```
       <?php
   
       /*
        * The Template for displaying all single posts.
        *
        * lambda framework v 1.0
        * by www.unitedthemes.com
        * since lambda framework v 1.0
        */
   
       global $lambda_meta_data;
       $meta_sidebar = $lambda_meta_data->get_the_value('sidebar') after elseif section:
   
       get_header();
       if($meta_sidebar != UT_THEME_INITIAL.'sidebar_none') {
       	st_before_content($columns='');
   
       } elseif($meta_sidebar == UT_THEME_INITIAL.'sidebar') {
   
       	st_before_content($columns='sixteen');
   
       }
   
       get_template_part( 'loop', 'single' );
       st_after_content();
       if($meta_sidebar) {
       	get_sidebar();
       } 
   
       get_footer();
       ?>
       ```
   
 * _
    [Please use the code buttons NOT blockquote buttons for posting code]
 * Did I do it correctly? What does the “if” “else if” part mean?
 * Here’s my site: [http://www.thehoundstoothblog.com](http://www.thehoundstoothblog.com)

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/sidebar-single-post-php-code-help/#post-3721418)
 * does the theme have any theme options to set a sidebar?
 * what theme exactly are you working with?
 * did the theme come with a read-me file or any other isntructions?
 *  Thread Starter [Andy8919](https://wordpress.org/support/users/andy8919/)
 * (@andy8919)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/sidebar-single-post-php-code-help/#post-3721561)
 * It does have a sidebar option but doesn’t appear to have an option for this.
 * I’m using this theme: [http://themeforest.net/item/arcadia-responsive-wordpress-blog/1944474](http://themeforest.net/item/arcadia-responsive-wordpress-blog/1944474)
 * I don’t believe it came with a read-me or instructions.
 * Did I do something in the code that will mess it up? I don’t know what `!=` and`
   ==` means?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/sidebar-single-post-php-code-help/#post-3721574)
 * please contact the theme’s developer (via themeforest ?) for support;
 * this forum cannot really help with commercial themes; [http://codex.wordpress.org/Forum_Welcome#Commercial_Products](http://codex.wordpress.org/Forum_Welcome#Commercial_Products)
 *  Thread Starter [Andy8919](https://wordpress.org/support/users/andy8919/)
 * (@andy8919)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/sidebar-single-post-php-code-help/#post-3721585)
 * They told me to contact you guys. I thought United Themes was the developer and
   Theme Forest was merely the vendor?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/sidebar-single-post-php-code-help/#post-3721586)
 * >  I thought United Themes was the deve
 * ok, then contact United Themes …

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

The topic ‘Sidebar single post php code’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/sidebar-single-post-php-code-help/#post-3721586)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
