New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: "failed to open stream" #278
Comments
Hey Lisa, I'm not sure why it can't find the file if it is inside the root of the theme folder. It should be able to see it. Is there maybe a file permissions issue? It's been a very long time since I've developed locally on a windows system so I'm sure exactly the best way to check the permissions on the file however the it should be readable by the user that runs the php process (honestly this might not make sense on a windows system... not sure???). If your still having this issue come back and let me know and I'll think about other ways to help you diagnose and fix the issue. But also if you found the solution please come back and post it to help others that might have the same problem. |
Same problem here any solution |
Maybe it should be defined like: |
Still not working & I didn't get any solution yet |
Hey, I am having a similar issue and have been looking all over the place for a solution and still haven't found one. What I have found is that it is a growing issue in which no one has seemed to have posted a repeatable solution.
|
Hi everyone, I am seeing a trend here and that all (or many at least) of you seem to be on Windows systems. On windows the paths used in php sound like sometimes they may behave in what looks like a slightly unpredictably way with regards to case sensitivity. The workaround of using If someone who has this error could possibly post the error message they see vs the output of get_template_directory() to see if they have are at all different. Also trying a require like this might also fix things:
|
Anyone able to confirm for me if there is a difference between the directory shown in the error for them and the directory output by get_template_directory() or dirname(FILE)? You could add this code to get those recorded in your error logs:
The 3 values should be in your error log file directly next to each other. If they are different then I will have an avenue to investigate to fix this error, if they are the same then I will have to look for another reason this is not working for you. |
Anyone managed to get this working yet? |
Hey @lisawedge, I think it will work for you if you require the file like this:
It would also be extremely helpful in finally figuring out the root cause of this if you could let me know what values are output from these commands are:
Hope this fixes if for you :) |
I have made some progress. I am playing with an underscores theme with Bootstrap v4 css and js being called via cdn. Previously I was using Bootstrap v3, perhaps this is a variable? Perhaps not. But now I'm getting an 'Add a menu' link instead of my menu. Maybe I've referenced the menu incorrectly? I have a menu called 'main', with the 'Primary' box ticked. |
ohhh that is good progress!! That link comes from the fallback function in the walker so the file is definitely being included now :) If you click the link you should be able to create a menu and add it to the nav menu you stated in the As for using this with bootstrap v4 sadly the master version doesn't work for v4. I've been working on an updated version though that does work for v4: https://github.com/wp-bootstrap/wp-bootstrap-navwalker/tree/v4 Note that the filename has changed in the v4 branch and that the readme may not be fully updated yet to account for any changed classnames. EDIT: These lines here are how I included it in one of my themes, you should be able to copy any changes from there into your themes code to make them work the same. https://github.com/pattonwebz/best-reloaded-bootstrap-theme/blob/master/header.php#L23-L55 |
I was following the installation instructions from https://wp-bootstrap.github.io/wp-bootstrap-navwalker/ and it turns out they have this line require_once('wp_bootstrap_navwalker.php'); while the actual file name is wp-bootstrap-navwalker.php that's why people like me got this error. I have seen other tutorials with the same mistake so maybe wp_bootstrap_navwalker.php was renamed to wp-bootstrap-navwalker.php at some point in time. |
@puertoagp Wow! So simple! I feel silly for not spotting such a simple mistake! |
Yes I too feel very silly for not spotting this... 😆 I completely forgot that instructions page existed and it has not had a real update for anywhere between 3-5 years! Since a resolution to this issue has been found I will close up this one and open a new one about updating the github pages repo. At least I learned some new things about nuances of php on Windows systems... not that I needed to know about that but... gotta be a silver lining here somewhere, right? :p |
Damn! Seems I had already corrected this. Back to the drawing board - still not working for me. |
With no progress posted for a long time I am going to close this issue again for now but as always if you are still having this problem feel free to reopen it or start a new issue and I will do my best to help you out if I can. Things like error logs and stack traces would be very helpful to figure out what is causing this if it's still a problem. |
Hello All,
I am getting the following error after following the instructions:
Warning: require_once(wp_bootstrap_navwalker.php): failed to open stream: No such file or directory in D:\sites\aim-hire\wp-content\themes\aim-hire\functions.php on line 375
I can confirm that the 'wp_bootstrap_navwalker.php' is in the root of the theme folder along with the 'functions.php' file.
I am developing locally at the moment, hence the local file path.
Any ideas?
Thanks,
Lisa
The text was updated successfully, but these errors were encountered: