WordPress.org

Ready to get started?Download WordPress

Forums

Sidebar single post php code (6 posts)

  1. Andy8919
    Member
    Posted 11 months ago #

    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

  2. alchymyth
    The Sweeper & Moderator
    Posted 11 months ago #

    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?

  3. Andy8919
    Member
    Posted 11 months ago #

    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?

  4. alchymyth
    The Sweeper & Moderator
    Posted 11 months ago #

    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

  5. Andy8919
    Member
    Posted 11 months ago #

    They told me to contact you guys. I thought United Themes was the developer and Theme Forest was merely the vendor?

  6. alchymyth
    The Sweeper & Moderator
    Posted 11 months ago #

    I thought United Themes was the deve

    ok, then contact United Themes ...

Reply

You must log in to post.

About this Topic