ThemeShaper Forums » Thematic

[closed]

Thematic: single-column layout

(8 posts)
  • Started 10 years ago by semube
  • Latest reply from yitwail
  • This topic is resolved
  1. semube
    Member

    Hi there!

    I am looking for a one/single-column layout for thematic (without sidebars).

    Basically I want to get rid of the sidebar and leave the main content area unchanged, just moving it to the center of the site. The footer should remain in a three column layout as of now. The structure is basically comparable to binarybonsai.com

    Anybody ever tried this? Any help would be appreciated!

    Best regards,
    Sebastian

    Posted 10 years ago #
  2. stamina
    Member

    Hi Sebastian,

    Did you manage to find out?
    I'm also trying to do that with only on static page.

    Kind Regards,
    Jorge.

    Posted 10 years ago #
  3. Juho
    Member

    I too would be very interested in knowing how someone with more coding experience might do this.

    Here’s what I’d do. I’m illiterate in PHP and I feel like I’m jumping through a lot of hoops and making it much more complex than it has to be, plus I’m probably breaking the whole Thematic framework in the process, so keep that in mind and take the appropriate precautions.

    Create a custom field for the page you want to appear this way. For example, a key named "single-column" with a value “on”.

    Then modify page.php. First create a variable for the custom field value:

    <?php $makeupavariable = get_post_meta($post->ID, "single-column", $single = true); ?>

    I’d probably just stick this to the top.

    Then look for <?php get_sidebar() ?> at the bottom and put it in an if statement that doesn’t utilize it when the current page has the custom field you created. Like this:

    <?php if($makeupavariable !== 'on') { ?> <?php get_sidebar() ?> <?php } ?>

    If you’re only looking to get rid of the sidebar, you’re done.

    In order to center the text I’d go and do the same to the <div> that controls the content, only this time put else in there too. I’m not sure but I’m guessing it’s the <div id=”content”>. Assuming it is, go to the CSS file you’re using and duplicate the #content ID and give it a different name, #content-b for example. Now modify it to suit your needs. Then the if statement (still in page.php):

    <div id=”<?php if($makeupavariable === 'on') { ?> content-b <?php } else { ?> content <?php } ?>”>

    Please note that I’m only guessing it’s the <div id=”content”>.

    Posted 10 years ago #
  4. stamina
    Member

    Hey Juho.

    Thanks for your quick reply. I have already managed to find a solution by using a custom template.php file between the header and the footer function calls :)

    That's great code for illiterate PHP by the way

    Kind Regards,
    Jorge.

    Posted 10 years ago #
  5. mnogueir
    Member

    Hello there! I just created my child theme in a single column layout. Check here: http://www.marionogueira.com

    It was rather easy; i followed some advice on the forum and put:

    function remove_sidebar() {
    return FALSE;
    }

    // Connect the filter to thematic_sidebar()

    add_filter('thematic_sidebar', 'remove_sidebar');

    on the functions.php. Then, some styling:


    /* Reset browser defaults */
    @import url('../thematic/library/styles/reset.css');

    /* Apply basic typography styles */
    @import url('../thematic/library/styles/typography.css');

    /* Apply basic image styles */
    @import url('../thematic/library/styles/images.css');

    /* Apply default theme styles and colors */
    /* It's better to actually copy over default.css into this file (or link to a copy in your child theme) if you're going to do anything outrageous */
    @import url('../thematic/library/styles/default.css');

    /* Prepare theme for plugins */
    @import url('../thematic/library/styles/plugins.css');

    /*Customização MN*/

    #wrapper { width:620px; margin:0 auto; }
    #branding { margin:0 auto; padding: 2em 0; }
    .menu { margin:0 auto; }
    #content { margin:0 auto; width:90%; overflow:hidden; }

    and some more tweaks...

    Posted 10 years ago #
  6. stevebob
    Member

    I found a slightly easier way to accomplish this. In the widgets section remove all widgets from the Primary Aside and Secondary Aside, then style the #main and #container to remove the padding added to accommodate the asides.

    Posted 10 years ago #
  7. yitwail
    Member

    This is an old topic, but I'm new to Thematic so bear with me. Takes nerve for a newbie to suggest something, but seems to me a more idiomatic way to turn off sidebars on just pages in a child theme would be this:

    In functions.php, add

    function th_show_sidebar($show) {
    	return !is_page();
    }
    add_filter('thematic_sidebar', 'th_show_sidebar');

    and in style.css, add

    .page #content {
        width:940px;
    }
    Posted 8 years ago #
  8. yitwail
    Member

    Of course, I now realize I should just specify Full Width template for each page. It was a good exercise anyway. :)

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.