• Hey guys.

    A company told me to extend a website using REACT and WordPress as a backend. Although much information is provided from the WP REST API, there are still some components we would like to “render” or at least to manipulate their data.

    As an example, there’s the “Recent Posts” widgets which we would like to get the “data” from it instead of going into the list of posts and selecting the “recent” ones.

    Things like this can be possible?

    Also, is there a REACT library to render the WP shortcodes?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    API posts requests by default return the most recent posts. You can request a certain number with the “per_page” query var. There’s no need to pluck recent posts out of a list.

    Shortcodes are PHP based and thus need to be processed server side. All REACT could do is make an API request for the rendered shortcode. AFAIK there is no such API endpoint by default, but you could create a custom endpoint for the purpose.

Viewing 1 replies (of 1 total)

The topic ‘WP React Headless (Rendering Items / Widgets / Shortcodes)’ is closed to new replies.