Skip to content

Examples: Using nodeByUri to replicate WP template hierarchy #751

@justlevine

Description

@justlevine

It would be great to see an example of implementing WP's template hierarchy with next+Faust.js.

For WP-to-headless devs, a big part of the transition is trying to implement everything WP gives you for free (also arguably a strong impetus for headless devs choosing WP as a backend), and both types of devs could benefit from some more advanced gqty examples.

An ideal example would:

  • have a primary pages/index.tsx that uses nodeByUri for hydration.
  • demonstrate how to fetch data from post, page and taxonomy types on the nodeByUri interface.
  • implement a few template/layout components that use WP's template hierarchy, e.g. <Template.Home />, <Template.Page />, <Template.Singular />, and maybe a custom template like <Template.FullWidthTemplate />
  • Bonus: use Next.js Persistent Layouts for components like <Header /> and <Footer />.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions