WordPress with Vue, GraphQL, and Node
WordPress development using Vue, GraphQL, and Express.
Read the Introduction to Vue Press
This repo is a starting off point for working with WordExpress using Vue. Its meant to work with WordExpress Server.
node 6.*
node 7.*
Please make sure you have cloned the WordExpress Server repo and have followed the instructions for getting it up and running. WordExpress server provides you with a connection to your WordPress database using GraphQL.
Using the /config/sample-client.config.json
file as an example, create a client.json
file. As of now, this the config files just point to the url of where your WordExpress Server is running, and which theme in the src/themes
directory to use.
yarn
yarn build
yarn start
=======
npm install
npm run build
yarn
yarn serve
In a fresh WordPress install, you’ll need to do a few basic setup items:
VuePress uses some custom post fields. You’re best bet is to install the Advanced Custom Fields plugin into your WordPress backend. I’ve included am acf-export
JSON file in this repo that you should import. This will give you just a few basic custom page fields that can be used to give your pages custom layout components.
Currently there are only three layout components - DefaultPage
, PageWithHeader
, and PostList
. In order to set the layout component, simply type the name of the component in the custom field. If there is nothing in the layout component field, DefaultPage
will be used.
In the backend:
Result:
In the backend:
Result: