• Resolved jamCincinnati

    (@jamcincinnati)


    I am building a theme for an artist website. It seems that even when I build a static page with no sidebar a space is left as if the sidebar was there. How would I go about changing a template to widen the content area when no sidebar is present?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Change the CSS for the elements remaining on that page so fill the empty space – you should be able to use a browser tool like Firebug or Chrome developer tools to find the relevant elements and/or CSS selectors.

    Thread Starter jamCincinnati

    (@jamcincinnati)

    If I change the CSS don’t I need to be able to tell if the page is a blog post (where I want the sidebar to appear) or a static page containing artwork (where I don’t want the sidebar space to appear).

    (And I have been using Firebug. How did people ever troubleshoot webpages before it came along?)

    Good question about Firebug – must have been pretty grim :)!

    Most themes output page and/or template specific classes in the body tag – so look there and use that class in the selector for the CSS for that page.

    Thread Starter jamCincinnati

    (@jamcincinnati)

    After I posted I remembered a theme where PHP if statements were used to determine how pages were shaped. I was thinking that if the CSS is set to a wider page in style.css I can make an exception for the blog – since the only place I need to make space for the sidebar is on the blog page. The CSS file would include a note as to the existence and location of the exception. My only reservation is that the if statement would have to use an inline style.

    <?php
    if (is_page('blog')): ?> {
        inline CSS to shrink content div to 70%
    }
    ?>

    It will have to wait till tomorrow though, it’s late and I’m falling asleep at the keyboard.

    ps Couldn’t live without Firebug!!!!! 😉

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sidebar space when no sidebar is present’ is closed to new replies.