-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
can't get wordpress plugin to work #6670
Comments
In your config you have |
@pieh I did not have them excluded before. I was trying to fix the errors so I added this. I get this error without having
As I explained in the issue, removing |
I reproduced this locally and this comes from this:
(translation of error message - "Sorry, you do not have permission to browse users.") We don't have access to list of users so we can't expand author field into object leaving To get that list I think we would need to authenticate. |
It's probably a WordPress plugin that is blocking access to enumerating users. Some believe it's a security concern. The default for WordPress is to make users public: https://json.wpengine.com/wp-json/wp/v2/users The easiest solution would be to find the plugin blocking access to the users endpoint and disabling it. You might be able to use a WP REST API basic auth plugin to put the endpoint behind auth and configure gatsby-source-wordpress to use those creds, but I don't have any experience with this. |
The WordFence security plugin was blocking this for me. I unchecked the option: |
still can't get this to work even though
|
Did you get this working? Looks like you need to remove the acf keys from your query in src/pages/index.jsx. |
You need to attach an ACF field to post type "post" in ACF, and the WordPress plugin |
if I remove acf from all queries, it throws these errors:
|
I think this starter kit should work for standard Wordpress installation out of the box. If I have to go through all these to manage to get it to work, what's the point? |
I got the same error. It feels like Gatsby + WP is not there yet. |
@hadifarnoud @kilinkis Unfortunately there were some fairly simple issues like this with the Gatsby WordPress starter. It's a community starter, not officially part of Gatsby. We've taken over maintenance and have fixed most of the issues you've hit above. We've removed the acf requirements. There are several different problems being discussed in this issue.
I'm going to close this issue now assuming these problems have been fixed, but please reopen the issue if not, or feel free to create a new issue here or on the starter repo and we'll do our best to help. |
@hadifarnoud @kilinkis We welcome your help to create a starter kit for WordPress and Gatsby without ACF. Please create a PR. A good starting point would be to remove all mentions to ACF in the starter kit |
@sebastienfi @hadifarnoud @kilinkis Just yesterday we started working on a Gatsby v2 WordPress starter. It doesn't have any reliance on ACF or other stuff. It's based on the Netlify CMS starter but ported to WordPress. Right now posts, categories, tags, and pages work. You can check it out here. |
Thank you @chmac I'll check it ASAP! |
Take of your Good luck! |
I've created PR #17317 to update the documentation to recommend using the starter recommended by @chmac - gatsby-starter-wordpress - to work around this issue. |
Wasted a whole day trying to make it work on XAMPP. I could easily play with the WP api using postman but gatsby-source-wordpress was not interested. Searching Google for an answer wasn't really helpful either. I like the idea. I love Gatsby and I like Wordpress...but I am not good enough at this to figure out how to fix a vexing problem on my own and there doesn't seem to be much support online either. I'll check back in a year or so. |
Summary
Cannot get wordpress plugin to work. I get errors about author, I deleted author section from graphql. then I got error about ACF, deleted that too. anything I do, it seems like there is something else broken. I feel like there is more serious issues. I followed official documentation.
ps: I'm using gatsby-starter-wordpress but don't believe that is the issue
Relevant information
Wordpress v4.8.7
$ gatsby develop
Environment
File contents (if changed)
gatsby-config.js
:The text was updated successfully, but these errors were encountered: