Forums

Defining theme in wp-config (6 posts)

  1. Snat
    Member
    Posted 2 years ago #

    I have looked in the wiki but haven't found anything so I am wondering if you could help :)

    Due to how my blog works, I want to change the theme depending on certain conditions. However, what I can't work out is how to define the theme within wp-config.

    If I can do this, this will be very helpful :)

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    The theme isn't defined in wp_config. It's in the db in the wp_options table.

  3. Snat
    Member
    Posted 2 years ago #

    Yes, I know that. What I wanted to know if I could somehow define it in the config file.

    Reason being is that I want to be able to overwrite it depending which domain the person accessed my site on.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Not sure of the fine details but, if I was doing this, I'd add a function to define which theme to use in functions.php and then call the function in header.php.

  5. Snat
    Member
    Posted 2 years ago #

    Right okay. Let me explain what I am doing, it might be easier to see :)

    I am using qTranslate. Now, I have both English and Hebrew on the site. In my wp-config file, I have made it so if the url is snat.co.uk then to set qTranslate as English and if it is snat.co.il then to set the language as snat.co.il.

    What I am trying to do now that if the domain is snat.co.uk it will use a theme called "English" or if it is snat.co.il it will use a theme called "Hebrew".

    Now, I do this in wp-config. What I am looking to do is able to change the theme depending on what domain it is. That part sadly, I am not having much luck on :(

  6. Snat
    Member
    Posted 2 years ago #

    Nevermind. Got another idea.

    Seeing it is in the database, I could just hardcode an SQL statement in the wp-config which then changes the theme each time. However, I wonder why the CPU usage would be like lol.

    Any other ideas before I try that ?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.