Load different template file when condition met?

Can you perform the logic on the template_include filter? Else, you could set a global/constant and use that in template_include to serve up the appropriate template. The template_include filter filers the path to the template file to be included. To avoid errors you should check if the template exists – locate_template does this for theme/child-theme … Read more

Hide page visual editor if template is selected – redux

The following works for me, testing with TwentyTwelve. Using load-{$pagenow} instead of admin_init avoids the checking for the global $pagenow. See comments for further info: // Run only when editing a page // For new pages load-page-new.php should be used // See: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/admin.php#L217 add_action( ‘load-page.php’, ‘hide_editor_wpse_88886’ ); function hide_editor_wpse_88886() { // Not really necessary, but … Read more