How to properly replace the_content with the html in a php file?
I've built a plugin that needs to overwrite the content on a specific page. It works, but it places all head content within the body, after my own html. Is there a way to fix that?
add_filter('the_content', 'overwrite_content');
function overwrite_content($content) {
if(is_page('Signup')){
require_once(plugin_dir_path(__FILE__).'/views/signup.php');
} else {
return $content;
}
}