How To: Three Column Pages & Two Column Posts

  • TopSpots

    #6305

    Hello…

    I did try to find an answer before posting this… but could not find it here.

    I have the theme set for three columns by default.

    I have already published many pages. And after a few months… now I am adding posts.

    (I think maybe I wasn’t thinking ahead when I started.)

    But what I want now is for the pages to stay three columns and the blog main page to be two columns as well as all new blog posts to also be two columns.

    Do I need to change the default… and then go in and select three columns for all of those pages? I hope not!

    Also… can I have different widgets for the blog than all of the site’s pages?

    Thanks!

    ~ Louie

    P.S. It seems that I cannot even make the blog main page with only two columns… even though I have selected “two columns, sidebar on the right”. ???

    Here is the site address: http://www.rshvac.com/

    Prasanna SP

    #33936

    Add this code to child-theme’s functions.php file. This will make all posts and main blog page two columns and sidebar on right.

    <?php
    function graphene_modify_layout(){
    if ( is_single() || is_home() ){
    global $graphene_settings;
    $graphene_settings['column_mode'] = 'two_col_left';
    }
    }
    add_action( 'template_redirect', 'graphene_modify_layout' );
    ?>

    TopSpots

    #33937

    Hello Prassana…

    Thanks. I have never setup a child theme. So, I guess I need to do that first.

    Or can’t I just add this to the main theme’s functions.php file. I have made no other changes to the theme… knowing that I’ll need to add it again when the theme updates. ??

    I tried to do a child theme once and things went out of whack for me.

    Also… will this code work when the home page is a static page? That’s how I have it setup now.

    Thanks again!

    ~ Louie

    Prasanna SP

    #33938

    Yes, you can add the code to parent theme functions.php. But you have to re-edit the file whenever you update the theme. I still recommend you to use a child-theme. At most you may have to update header image, custom menus and background image. Other than that nothing goes horribly wrong, I believe..

    Here is the updated code which works for static front page too.

    function graphene_modify_layout(){
    if ( is_single() || is_home() || is_front_page() ){
    global $graphene_settings;
    $graphene_settings['column_mode'] = 'two_col_left';
    }
    }
    add_action( 'template_redirect', 'graphene_modify_layout' );

    If you are going to add this to parent-theme’s functions.php, add this above

    /**
    * Load the various theme files
    */

    TopSpots

    #33939

    Thanks Again…

    I decided to go another route. It was easier than I thought to revert the pages to use “three column” template… and change the default for the whole site to two column with right sidebar.

    Only took me like 30 minutes… and it’s done. Everything seems to be working fine.

    My other question was…

    How can I have different widgets for the blog main page and all blog posts?

    Is this possible?

    Thanks Again!

    ~ Louie

    Prasanna SP

    #33940

    Enable alternate front page sidebars or use conditional tags.

    Sorry for a short reply. On mobile..

    TopSpots

    #33941

    Prasanna…

    I’m a bit green to some of this stuff. I sure appreciate your help, but…

    When you have more time, can you explain how / where I would use conditional tags??

    (I found the alternate front page widget option). It would be really cool if we had a separate post widget section.

    Thanks! You truly are appreciated!

    ~ Louie

    Prasanna SP

    #33942

    Tomorrow. It’s midnight here. I gotta sleep now. 🙂

    Prasanna SP

    #33943

    Go to Graphene Options –> Widget Area Options and enable Enable alternate front page sidebar widget area. Then new widget area appears in widgets page. Any widgets added to them will appear on front page only.

    70KSF.png

    TopSpots

    #33944

    Hey There…

    Thanks, but in my message above I said:

    (I found the alternate front page widget option). It would be really cool if we had a separate post widget section.

    When you have more time, can you explain how / where I would use conditional tags??

    ~ Louie

Viewing 10 posts - 1 through 10 (of 12 total)

You must be logged in to reply to this topic.