SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sidebar not disappearing?

    Hi all, I made a child theme using Thematic's framework. I was following along with the book, "How to build your own wicked WordPress theme". It had me copy the index.php file from thematic and rename it "home.php". And had me comment out the sidebar, however it's still on the homepage, just moved down the page. Can anyone help?

  2. #2
    SitePoint Addict deadmix's Avatar
    Join Date
    Jun 2009
    Location
    france
    Posts
    205
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    hello there,

    simply open your home.php look for <?php get_sidebar(); ?> and replace it with :

    Code:
    <?php if (!is_front_page()) { 
        get_sidebar();
    } ?>
    That will hide the sidebar from the homepage and displaying it on all the other pages/posts...

    Goodluck

  3. #3
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply!
    Sadly, the code you've provided didn't effect the page output. The sidebar stayed put. I tried moving the home.php file out of the folder containing my WordPress theme but it still had no effect on the page itself. Any other ideas?

  4. #4
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    634
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    probably not as elegant as deadmix. But am still newish to wp.
    I just comment out the sidebar or remove it altogether from the pages where I don't want it.
    <!-- ? get_sidebar(); ? -->


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •