开发者 | swissspidy |
---|---|
更新时间 | 2015年4月24日 03:23 |
PHP版本: | 3.4 及以上 |
WordPress版本: | 4.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
switch_theme()
trickery, widgets and menu settings will be preserved.
This doesn't guarantee perfectly styled posts though, so make sure to do some testing first.
When you deactivate the plugin, everything will go back to normal. Uninstalling deletes the theme change history.
Have a look at the FAQ to see how you can use this plugin with older posts.
See this blog post for further information about the plugin.
Original idea by Christian Leu.
keep-my-theme
folder to the /wp-content/plugins/
directoryCheck if the theme is still installed in WordPress. The plugin can't activate a theme that isn't available anymore.
Good question! You can use the keepmytheme_history
filter to let the plugin know which themes were active a couple of years ago.
Example:
`
function change_keepmytheme_history( $history ) {
$history[ strtotime( '2010-08-01' ) ] = 'default', // I've used the old default theme after August 1st, 2010.
$history[ strtotime( '2014-01-01' ) ] = 'twentyfourteen' // I've used Twenty Fourteen after January 1st, 2014.
return $history;
}
add_filter( 'keepmytheme_history', 'change_keepmytheme_history' );
`
Note: You should put this snippet in a new (must-use) plugin or your current theme's functions.php
file.