• Resolved seomozo

    (@seomozo)


    Hi,

    My blog url is: http://seomozo.com

    I am using a custom theme named “stheme” and I have made a new page as home page. I want the right sidebar removed from home page and I could do that with using css code in Main index file. However the right sidebar is removed from the blog page which is not my home page.

    So how do I remove the right sidebar from my custom home page? If I use the same css code with ‘display:none’ in “page” template, it removes the sidebar from all the pages as my custom home page is using this “page” template.

    Can anyone please suggest me a fix? I believe this is something to do with PHP code, I am just puzzled. Please help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You might consider creating / uploading a custom static XHTML page and then go into your WP dashboard and set your preferences to use the new static page as your homepage.

    You can link the existing CSS file to the new page… Or, create a custom CSS file for the new static page.

    Thread Starter seomozo

    (@seomozo)

    Hi MitchG,

    Thanks for your input. I have this in mind but I wanted to consider it as the last resort. Lets see if some PHP expert in WordPress or may be the Stheme guys themselves could prove being THE SAVIOR.

    Using conditional tags in your index.php / page.php theme file:

    <?php
      if (is_front_page()) {
      } else {
        get_sidebar();
      }
    ?>

    I’m not a php expert but this should work. (I’m certain that a php expert would code this in a more efficient and elegant manner)
    http://codex.wordpress.org/Conditional_Tags

    Thread Starter seomozo

    (@seomozo)

    I could use this code but the problem is that it takes the blog page as the front page and not the custom home page that I am using as home page.

    did you read the link about conditional tags?? try with is_page(x), where X is the number ID of the page you are using as front page.

    <?php
      if ( is_home() || is_page(X) ) {
      } else {
        get_sidebar();
      }
    ?>

    Thread Starter seomozo

    (@seomozo)

    SWEET! IT WORKED!

    THANKS MUCH Xamataca!

    You’r welcome
    And remember: Codex & search are your friends 🙂

    I hate it when bone-heads like Xamataca make comments like “search is your friend.” While doing a search this page came up. I suppose you’ve never asked a question on any forum looking for help? Your arrogance is annoying, and I feel sorry for those around you that must suffer in awe of your intelligence….

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Removing sidebar from a single custom page’ is closed to new replies.