# Issue with a plugin that uses locate_template()

**URL:** https://discourse.roots.io/t/issue-with-a-plugin-that-uses-locate-template/21588
**Category:** sage
**Tags:** sage9, blade
**Created:** 2021-10-19T15:20:55Z
**Posts:** 3

## Post 1 by @wfuk_stu — 2021-10-19T15:20:55Z

Hi,

I’m trying to use a plugin that is calling the following:

```
/**
 * @return string
 */
function template_include() {
	return locate_template( array( 'page.php', 'single.php', 'index.php' ) );
}
```

But because the theme passes everything through the blade files it just returns a white screen for the empty index.php.

Does anyone have any ideas on how to get around this?

---

## Post 2 by @rjackson — 2021-10-21T21:52:23Z

I wonder if they have a hook at a higher level that could affect this. The `locate_template` function does not actually include any PHP template files by default. Since the `$load` argument defaults to `false` it should just be returning the template file path.

```
function locate_template( $template_names, $load = false, $require_once = true, $args = array() ) {
    ...

    if ( $load && '' !== $located ) {
        load_template( $located, $require_once, $args );
    }

    return $located;
}
```

### Less ideal idea

If there are no better options, you can just mirror the plugin and make the change. If you’re deploying with bedrock then you could host it on a private repo. This should include some sort of auto-update and notifier for changes.

---

## Post 3 by @system — 2021-11-30T15:21:15Z

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