• Resolved paulslocum

    (@paulslocum)


    I’m trying to figure out a way to display different themes depending on which URL you go to. Like you go to index.php and get the original theme, or you go to index2.php and you get an alternate theme. I’m willing to modify WordPress if necessary, I’ve already made quite a few modifications.

Viewing 4 replies - 1 through 4 (of 4 total)
  • moshu

    (@moshu)

    or you go to index2.php

    There is no index2.php and WP will never work with a filename like that – so forget it.

    You use ONE theme in one WP installation.
    You van, however, install some theme-switcher plugin, that lets you (and visitors) select from the installed themes.

    Thread Starter paulslocum

    (@paulslocum)

    it works just fine on my site:
    https://www.spiritsurfers.net/index2.php

    What I envision is that index2 sets a variable or something that overrides the current theme selection. Obviously I’d have to modify some wordpress code to make this happen.

    I’ll look into the theme switcher since it’ll probably give me a clue as to which code I need to change.

    taffeljohan

    (@taffeljohan)

    Look at wp-includes/theme.php.

    It looks as if you could use the stylesheet and template filters to set the theme, just by modifying the values sent through to point to the theme directory you want. Everything else builds on those two.

    Or you could define TEMPLATEPATH and STYLESHEETPATH (see wp-settings.php) to what you want. This will mean that WP tries to define already defined constants in wp-settings.php, but that wouldn’t be a problem in practice. Doing it with filters is aesthetically more appealing.

    Thread Starter paulslocum

    (@paulslocum)

    I used the hack method, setting TEMPLATEPATH and STYLESHEETPATH in the index2.php. It works great, thanks! I thought I’d have to rewrite some code.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Two Themes’ is closed to new replies.