WordPress themes gallery
-
Hello,
I need to use WordPress to make WordPress themes gallery website, which means, when anyone opens website it will display theme which is defined in wp settings, but if visitor opens website via e.g. https://www.website.com/?theme=classic – it should display classic theme (wp-content/themes/classic). I have edited wp-includes/theme.php and replaced every
get_option('template');
withget_template();
and then I have modified get_template() function so this is how it looks now:function get_template() { $template = (isset($_GET['theme'])) ? $_GET['theme'] : get_option('template'); return apply_filters('template', $template); }
Now, when I open https://www.website.com/?theme=classic it changes layout but old theme is still displayed.
I’m testing this on my website so you can take a look: https://www.avramovic.info and https://www.avramovic.info/?theme=classic
Also, https://www.avramovic.info/?theme=default causes PHP error. I don’t know which files I need to edit except wp-includes/theme.php to make this work (or, is there any plugin which will provide such functionality?).Any ideas?
Thanks,
Nemanja
- The topic ‘WordPress themes gallery’ is closed to new replies.