Full-width layout only for Posts (Stargazer 2.0)

4 Replies ·

  1. My site is the default layout “2 Columns: Content / Sidebar”

    I would like to make all 900 or so Posts full-width layout.

    Basically I want:

    Pages: 2 columns: content/sidebar
    Posts:  full-width

    Is this possible with the new Stargazer version 2.0 please?

    Thank you very much!

    Marcus Tibesar
    Tibesar Family Archives
    https://tibesar.com

  2. Justin Tadlock

    Yes, this is possible. In order to do this in the best way, I need to know what your global layout is set to.

  3. Justin Tadlock

    OK. So, what we need to do is add a filter in your `functions.php` and change the layout for pages. This code should handle that.

    `
    add_filter( ‘hybrid_get_theme_layout’, ‘my_theme_layout’ );

    function my_theme_layout( $layout ) {

    return is_page() ? ‘2c-l’ : $layout;
    }
    `