AnsPress shows white screens when Sage is the active theme

AnsPress is a question and answer plugin. It creates its own question post type and routing is done via static pages with a shortcode inserted on each page ([anspress]).

For some reason everything is working fine with the default WordPress themes, but as soon as I load a stock Sage theme (9.0.9) all question related permalinks show a white screen (I’m using Bedrock too). There’s no WordPress error output and the PHP error.log is also empty.

My guess is that’s the problem is somehow related to how Sage loads template files, but I’m not sure how to debug. Does anybody have any pointers for at least getting some feedback to pinpoint where the plugin is failing in relation to Sage?

I think I’ve found the problem.

AnsPress uses its own function to assign templates by overriding template_include like Sage does and it passed the empty index.php file in the resources directory.

I’ve removed the filter and everything appears to be working now, because Sage is handling everything again:

remove_filter( 'template_include', ['AnsPress_Theme', 'anspress_basepage_template'], 9999 );

This topic was automatically closed after 42 days. New replies are no longer allowed.