Overriding the Global Layout for the Message Board

7 Replies ·

  1. Hi Justin,

    I have gone live with my forums now. Very nice work.

    In other Message Board topics in this forum you show screenshots of what look like full-width 1-column wide layouts.

    I’d like to display my forums and their subordinate topic pages in 1-column wide as well.

    How do I override my Global Layout (2 columns: Content / Sidebar) for my Board page please?

    I can’t seem to find the Board page in my Pages in order to change the Layout there.

    Thank you very much!

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

  2. Justin Tadlock

    How do I override my Global Layout (2 columns: Content / Sidebar) for my Board page please?

    Add this code to your child theme’s `functions.php` file:

    `
    add_filter( ‘theme_mod_theme_layout’, ‘my_board_theme_layout’, 99 );

    function my_board_theme_layout( $layout ) {

    if ( function_exists( ‘mb_is_message_board’ ) && mb_is_message_board() )
    $layout = ‘1c’;

    return $layout;
    }
    `

    Keep in mind that this code may need to change in the future as I continue building the plugin. Some things may change.

    I can’t seem to find the Board page in my Pages in order to change the Layout there.

    There’s not really a “page”, not exactly. Well, there’s a “page” in the general sense of the word but not in the sense of a WordPress Page. That even confused me. πŸ™‚

    Basically, you have to create custom links. The URLs will be:

    `
    yoursite.com/board
    yoursite.com/board/topics
    `

  3. Marcus Tibesar

    “Keep in mind that this code may need to change in the future as I continue building the plugin. Some things may change.”

    I have been wanting to change over to a 1-column wide global layout for some time so this spurned me on.

    I have now moved the Primary-area widgets to pages and added the pages to the menus. Much cleaner that way and I don’t insert temporary code into the child-theme’s functions.php file.

    I am sorry for wasting your time on this Justin – hopefully someone else in the community will be able to use this topic’s code. Or perhaps me in the future – you never know! πŸ˜‰

    By the way what Message Board are you using on this site’s (themehybrid.com) forum? Is it your Message Board?

  4. David

    Hi Marcus,

    Yes, this site is using the Message Board plugin. It has evolved over the last year or so. BTW, your home page looks really nice. I like the color scheme.

    Best,

    David

  5. Justin Tadlock

    Oh, I missed that last question. I’m using the MB plugin here. However, it’s a big mix of the latest version of the plugin, a few older versions, and some custom stuff. So, I’m not completely up to date. Once I get the 1.0 release out, I plan on updating this site.

  6. Marcus Tibesar

    @David – can’t take credit for the color scheme. It’s a fork from Mike Matenkosky’s beautiful photography site at http://www.imagesinthebackcountry.com/

    His site http://www.thebackcountry.org/ is a gorgeous Stargazer child theme as well!

    @Justin – that’s really great news Justin. I like this older mixed-bag version of yours a little better because it is more simple than the new one (IMO). Thanks for all the hard work you do!

  7. Justin Tadlock

    It’s also completely broken in places. I’ve just hidden most of those things. πŸ™‚

    When it comes down to it, it’s all going to be about theme-specific implementation. One of the things I hate about bbPress themes, for example, is that that the forum designs all look the same. My plan is to try and force theme authors into actually thinking about forum design. I want to give them a starting point but not try to do everything for them. I think that will open up a bit more creativity.

    Now, I actually have to get 1.0 out the door at some point!