tags:

views:

52

answers:

3

I'm testing a new template for a wordpress based site, and I'd like to test it directly on the live version instead of making copies. I thought I could create a test user (wordpress is bridged with vbulletin which handles user auth), serve the usual theme to anyone BUT that specific user, who would get the new testing one.

I don't want to install a plugin, I'm looking for the right place to edit to insert this check:

if logged user == test_user_id
    serve 'testtheme'
else
    serve 'normaltheme'

The userid can be get from $_COOKIE. I tried hacking the get_template() function in wp-include/theme.php but apparently that was not enough. Any suggestion?

+1  A: 

Just logging into my old Wordpress.com blog, I see that I can do all the previewing I want from the themes manager already - click around to any page I like, or bring up the frame's URL to see what query string I'd have to append to a URL to get the same preview, e.g.

?preview=1&template=pub/mytheme&stylesheet=pub/mytheme

Any reason that's not enough?

Matchu
I need to show it to people who don't (and can't) have admin access
kemp
A: 

Perhaps you should add a column to your user table, call it "is_beta" and if it's set to 1 then enable beta features/themes. This way you can easily add or remove people from the beta, and when you're beta is ready to launch, you flush the column for everybody and make the features default.

TravisO
+1  A: 

This is the best way to "test" or develop a theme behind the scenes without needing to alter too much of your Wordpress core or make custom changes...

http://digwp.com/2009/12/develop-themes-behind-the-scenes/

Urda
Nice article, seems like the best solution. Will try asap, thanks
kemp
No problem! Let me know if it does it for you. ;)
Urda
[theme test drive](http://wordpress.org/extend/plugins/theme-test-drive/) works perfectly, it's just what I needed thanks a lot!
kemp
Glad I could help :]
Urda