Add a custom navwalker into Roots/Sage 10

Hello everyone,

I hope you’re all doing well.
I have a question regarding the right way to add a custom navwalker into Roots/Sage 10.
I appreciate any assistance provided.
Thank you!

I use @Log1x navi package on every project. GitHub - Log1x/navi: A developer-friendly alternative to the WordPress NavWalker.

3 Likes

I appreciate the solution, but it seems I’m running into some issues. I’m getting these errors:

Warning : file_get_contents(/Users//Local Sites//app/public/wp-content/themes//public/js/runtime.js): Failed to open stream: No such file or directory in **/Users//Local Sites//app/public/wp-content/themes//vendor/roots/acorn/src/Roots/Acorn/Assets/Bundle.php** on line 125

Fatal error : Uncaught ReflectionException: Class “navi” does not exist in /Users//Local Sites//app/public/wp-content/themes/****/vendor/illuminate/container/Container.php:889 Stack trace: #0

@Log1x

Any ideas on how to fix them?
Any other suggestions?

The first error I think is related to you needing to compile Bud.

The second error might be related to you not having post-autoload-dump in your composer.json alongside Acorn and Navi. You can see the steps for that on the Acorn installation docs.

To fix it immediately, try wp acorn optimize:clear.

It works :smiley:
Thank you
Is it advisable/safe to implement this on a high-end project?

Yes. It is very stable and used on a lot of sites as far as I know.

Thank you very much @Log1x

1 Like

I’ve observed that after integrating Log1x/Navi into my project, I encounter errors whenever I make changes to my code:
**Warning** : file_get_contents(/Users/****/Local Sites/****/
These errors persist until I manually run a Bud compilation.

You’re going to have to give the full error without truncating the path, I have no idea what it is referring to in this context.

In any case, this is highly unlikely to be related to Navi.

Thank you
I’ll get back to you with more details