• Resolved jakesimpson

    (@jakesimpson)


    function force_archive_template($template){
        if( is_archive() ) {
            // Set this to the template file inside your plugin folder
            $template = WP_PLUGIN_DIR .'/'. plugin_basename( dirname(__FILE__) ) .'/archive-final_decisions_cpt.php';
        }
        // Always return, even if we didn't change anything
        return $template;
    }
    
    add_filter( 'template_include', 'force_archive_template' ) ;

    The above code is being used to force use a template from my plugin as opposed to the theme. It works fine for one site in a network of three. The page can not be found for the other two sites. I also tempted to zip and use plugin in another network of sites and the page could not be found at all. Help please

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘force template not working’ is closed to new replies.