wordpress-nextjs
v0.0.3
Published
API and helper functions for connecting to a WordPress instance.
Downloads
9
Readme
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-nextjs
or
npm i wordpress-nextjs
Once 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} />
</>
}