Sidebar single post php code
-
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
-
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?
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
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?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
They told me to contact you guys. I thought United Themes was the developer and Theme Forest was merely the vendor?
I thought United Themes was the deve
ok, then contact United Themes …
- The topic ‘Sidebar single post php code’ is closed to new replies.