Skip to content
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

Get Page by ID, when the page is a Post Archive, returns the incorrect data #29

Open
charles4221 opened this issue Jan 14, 2019 · 0 comments

Comments

@charles4221
Copy link
Contributor

I have a page called "Blog" which I have configured as the "Posts Page" via WP Settings -> Reading. This page's ID is 20. I then have a couple of test posts created, with the intention of building a post archive template from this data.

However, when I query the endpoint better-rest-endpoints/v1/page/20, I get the following response:

{
    id: 25,
    title: "Pluto is definitely a planet",
    slug: "pluto-is-definitely-a-planet",
    permalink: "domain/pluto-is-definitely-a-planet/",
    template: "default",
    content: "<p>TRUST ME! Don&#8217;t listen to Neil DeGrasse Tyson.</p> ",
    parent: false,
    acf: null,
    yoast: null,
    media: false
}

This is actually the data pertaining to the most recent post which would be shown within that archive, as opposed to what you'd expect to return (the data for the actual archive page itself, i.e. { id; 20, title: "Blog", slug: "blog", permalink: "domain/blog/", etc etc. }). When I visit the default WP REST API endpoint for this page (wp/v2/pages/20) I do get the correct object in response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant