I working on my plugin and tried to override some templates.
If I visit the page portfolio my screen gives a whitepage.
This is my code
define("PLUGIN_DIR_PATH", plugin_dir_path(__FILE__));
add_filter( 'template_include', 'plugin_tweak_template', 99);
function plugin_tweak_template( $template ) {
if ( is_page('portfolio')) {
$template = PLUGIN_DIR_PATH . 'required/templates/portfolio.php';
}
return $template;
}
I use this code in my plugin root file.
I working on my plugin and tried to override some templates.
If I visit the page portfolio my screen gives a whitepage.
This is my code
define("PLUGIN_DIR_PATH", plugin_dir_path(__FILE__));
add_filter( 'template_include', 'plugin_tweak_template', 99);
function plugin_tweak_template( $template ) {
if ( is_page('portfolio')) {
$template = PLUGIN_DIR_PATH . 'required/templates/portfolio.php';
}
return $template;
}
I use this code in my plugin root file.
Share Improve this question asked Apr 14, 2020 at 21:59 SebasSebas 132 bronze badges1 Answer
Reset to default 0The white screen means that you have a critical error that is halting execution, but you do not have PHP messaging turned on to tell you what that error is.
Turn on debug mode in WordPress so the error message is displayed. Otherwise you don't have enough information to correct your problem. Set the WP_DEBUG
constant in your wp-config.php
file to true
. See: Debugging in WordPress
Once you know what that error is, you can edit your question with more information.