Is there a function or a hook that runs only when a theme is previewed?
I’m referring to the preview feature that you get on the Appearance->Themes page.
The reason for this is that I want to change specific design aspects on the theme but only when the user is previewing it.
2 Answers
I think you could use the ?preview=true in the url something like :
if ($GET['preview']) {
// your hook or function
}