Plugins assuming that index.php is working (Ninja Forms)

Ninja Forms assumes that index.php theme file exists when clicking preview. Since in sage it is called index.blade.php, and index.php is an empty file, the preview does not work. Wordpress theme documentation says that index.php is required in all themes, so I would say that this is an issue with Sage and not with the plugin.

I found another post in this forum with which I was able to add & modify this piece of code in functions.php and fix the error:
add_filter(‘template_include’, function ($template) {
if (substr($template, -9) ===“index.php”) {
$blade_template = locate_template(‘views/index.blade.php’);

        return ($blade_template) ? $blade_template : $template;

    return $template;

It seems to work, but not sure if this is the best way to solve this issue? If it is, should it be included in the sage base in order to follow the WP standard?

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