Closed giekaton closed 5 years ago
If I load pages list through pages widget, the missing page is not shown
<span>
<!---->
</span>
If I delete this page, and create a similar new one - it start working, but then some other page stops working.
Any ideas where to look for the cause? The missing pages can be accessed through /wp-json/wp/v2/pages/{id} or through wp editor, but vue shows the above error and no content.
WP fresh install, no plug-ins, latest vuejs-wordpress-theme-starter version.
I just tried it out and had the same problem, but got it working!
In src/settings.js:
API_BASE_PATH: "/?rest_route=/wp/v2/"
I don't kow why, this is another way of reaching the api. I think it has to do with the vue-router intercepting the normal path. But I might be wrong.
AND THEN, because we're using the parameter way of using the REST API, we have to change the axios call to use arguments:
So, in src/api/index.js:
axios
.get(SETTINGS.API_BASE_PATH + "pages", {
params: {
per_page: '1'
}
})
.then
Or whatever parameter you want.
Hope this helps!
@pmcp thank you for looking into this.
It was even more simple. I didn't need to change the settings.js (tried, but it didn't work for me). I only needed to change the default per_page limit. Set it to 40 and now everything works fine.
@EvanAgee this can also be included in the FAQ :)
axios
.get(SETTINGS.API_BASE_PATH + "pages?per_page=40")
Ah perfect. Weird, but ok, if it works, it works ;)
Quite a strange issue I'm having.
Everything worked fine when I had ~3 pages. Now I created ~13 pages, and when accessing some pages through router-link or direct url, I get the below pasted error.
Then if I recreate with the wp the page(-s) that I can't access, it starts working. But after this, some other page(-s) stops working which was working fine before. Any ideas?