• Blog: <https://www.toobroketofix.com&gt; – Theme: MistyLook 3.6.1

    I’m going crazy with this one. You hear that SEO is compromised if you have your sidebar anywhere but the main page. Yet I can’t find anyone who can suggest how to do this.

    I want to have the sidebar on home/front page but nowhere else. Anyone can help?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Ok it depends on how your theme is working. First check single.php or page.php file and search for the sidebar code
    <?php get_sidebar();?>

    find it then remove it from single.php and page.php

    You crazy kids and your SEO fanatacism… ??

    Anywho, take a look at the Default theme. It manages the sidebar that way (hint: Conditional_Tags)

    Thread Starter toobroketofix

    (@toobroketofix)

    HandySolo, I couldn’t agree more. In the time spent trying to perfect SEO and security I could have written umpteen posts. Worse, as I have nothing to sell all this SEO isn’t gonna help a bit! However, I have discovered within me a latent plug-o-mania and its attendant problem-solving code compulsion. I’ll check out yr URL. Looks promising.

    smub: the problem then is there is all that white space where the sidebar was. In the theme I’m using there is no widecolumn, narrowcolumn. So I’d better put on more coffee, I guess.

    just open your sidebar.php follow the below steps

    1. on top-most (line 1) of the file

    for wp 2.5 + add
    <?php if (is_home() || is_front_page() ): ?>

    for other version add
    <?php if (is_home() ): ?>

    2. At the end of sidebar.php just after “<!– end id:sidebar –>”
    add
    <?php endif; ?>

    additionally
    the theme will look weird without a sidebar, so to make the main content fill all the space left by the sidebar. you might to add the below code inside misty functions.php

    if (is_home() || is_front_page()){
     add_action('wp_head','misty_css_content_width');
    }
    
    function misty_css_content_width()
    {
    ?>
    <style type="text/css">
    /*<![CDATA[*/
    #content-main{width:auto !important}
    /*]]>*/
    </style>
    <?php
    }

    Thread Starter toobroketofix

    (@toobroketofix)

    During the posting by chaoskaizer I FINALLY SOLVED THIS PROBLEM. Here’s how:

    1) A few days ago I came across the following support topic from a couple of months ago:

    Can you hide the sidebar in a Page?

    Scrolling down to a comment by a certain “genevaeagles” I found his code for “Template Name: Page Templage w/o Sidebar” (see above link). At the time I didn’t think it applied, but a few hours ago I went back to it. I changed the Template title to No Sidebar (no_sidebar.php) and uploaded it to my mistytheme folder.

    2) I then edited the css file of my theme by copying the #content-main code, renaming it #content-fullcolumn and extending the original width of 520px to 720px. A shame there isn’t some uniformity in css jargon.

    3) Then in the following Theme files: Single Post, Page Template, Archives (archives.php), I changed <div id=”content-main”> to <div id=”content-fullcolumn”> at the top, and removed <?php get_sidebar();?> at the bottom. I may have to change others as time goes by, but this is a new blog so there’s only a few posts so far.

    4) I made this change on the 404 Template as well, but it still shows the sidebar, which may not be a bad thing.

    So, the No Sidebar template of genevaegles may only effect pages, but the other code has successfully knocked the sidebar out of posts and everywhere else but the homepage.

    chaoskaizer, I will try your solution as soon as I get my eyesight back, though at the moment I am to such code as Alan Turing’s gardner was to the Enigma Machine.

    Thanks to all and sundry.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘kill sidebar on all but main page’ is closed to new replies.