Skip to:
Content
Pages
Categories
Search
Top
Bottom

Multiple Templates Simultaniously!

  • @ggwarpig

    Participant

    I need to have two domains pointing at the same bbPress setup each with a different template.

    Should I setup two installations and point them both at the same database. Can you even do that?

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • @kevinjohngallagher

    Member

    Hi GGwarpig,

    It is possible with my “themer” plugin, which has an option to dynamically load a different header/footer file or just a different stylesheet depending on the domain you’re looking at. While this doesn’t load in an entirely different theme, it incorporates most of the changes you’re looking for.

    Sadly it can’t be released until we get an answer to this (what appears to be) bug in the core: https://bbpress.org/forums/topic/overwriting-template-functions

    @_ck_

    Participant

    My theme switcher plugin is capable of doing this quite easily, it already allows each visitor to select the theme they want.

    All you would need to do is change the cookie support code into session support code so the server controls which theme is seen instead of the visitor.

    Should take all of an hour to convert for someone who understands cookies and sessions.

    Actually if the domain is fixed you can just use $_SERVER['HTTP_HOST'] or $_SERVER['SERVER_NAME'] to determine the theme to use which makes it even easier.

    @ggwarpig

    Participant

    The domain is fixed ( its actually independant subdomains, but same difference right?). _ck_ Any chance you can crank out this hack?

    @_ck_

    Participant

    Just install my bbpress theme switcher plugin, disable the dropdown.

    Then replace function bb_ts_get_theme() {

    with something like this (untested, will need some editing)

    function bb_ts_get_theme() {
    $theme="kakumei"; // default fallback
    $domain=strtolower($_SERVER['HTTP_HOST']);
    if (strpos($domain,"first-domain.com")!==false) {$theme="1st-theme";}
    if (strpos($domain,"second-domain.com")!==false) {$theme="2nd-theme";}
    return $theme;
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar