0.0.3 • Published 4 years ago
wordpress-nextjs v0.0.3
Wordpress Next.JS Connector
Utility package to connect Next.js to a Wordpress instance.
WARNING! This package is still a work in progress and it's being developed continuously, because of this, no production site should use this yet. If you're using this package make sure to set the current version in your package.json so future updates don't break the code.
Installation
The connector can be installed as a npm package into a front-end using Next.js.
yarn add wordpress-nextjsor
npm i wordpress-nextjsOnce installed call Wordpress.init(URL) in your _app.js file, example:
import React from 'react'
import Wordpress from 'wordpress-nextjs'
function MyApp({Component, pageProps}) {
Wordpress.init('https://wordpress.yourdomain.com')
return <>
<Component {...pageProps} />
</>
}