# dirname(__FILE__) giving wrong path

**URL:** https://discourse.roots.io/t/dirname-file-giving-wrong-path/20512
**Category:** sage
**Created:** 2021-04-03T19:24:33Z
**Posts:** 1

## Post 1 by @AurelianSpodarec — 2021-04-03T19:24:34Z

I’ve always used ACF with Flexible Content because I think its a great way to create blocks/components that needs to be used or repeated thought the site.

I’m using Sage now, and prior to that I tried different things.

I’m having an issue with this though,

The path I get, is this

```
...wp-content\themes\kayTheme\storage\framework\views\blocks\text.php
```

While using this code: $flexibleContentPath = dirname( **FILE** ) . ‘\blocks\’;

That’s one issue - how do I fix this? So far I wrote the hardcoded path.

---

## Post 2 by @system — 2021-05-15T19:24:36Z

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