Code Monkey home page Code Monkey logo

nextjs-wordpress-theme's Introduction

๐ŸŽจ Next.js WordPress theme - Celestia

Project Status: Active. Stars Forks Contributors Follow

  • A React theme for WordPress, using Decoupled Architecture in Next.js
  • Front end in React
  • Backend in WordPress.

Evironment vars.

rename .env-example to .env and add your WordPress Site URL

WordPress Setup

  • Download, Upload and activate all the plugins from wordpress/plugins folder of this repo, into your WordPress Site.
  1. wp-graphql - tested on ( v1.0.0 )
  2. Headless CMS
  3. WP GraphQL Gutenberg

Development

npm run dev # Runs next dev which starts Next.js in development mode
npm run build # Runs next build which builds the application for production usage
npm run start # Runs next start which starts a Next.js production server

To run cypress locally we run cypress-open It adds a cypress directory and some example test in cypress/integrations

npm run cypress:open
  • Cypress docs
  1. API

Debugging with Node.js debugger tool.

Notice that we have added this in package.json

"dev": "NODE_OPTIONS='--inspect' next",

when you run npm run dev, you will see a node js icon in the Chrome inspector tab and there will also be a url to access it on the terminal that says Debugger listeing on ...

Important concepts

  1. Prerendering
  2. Querying blocks: WP GraphQL Gutenberg allows you to query Gutenberg blocks. If you want to break down the blocks and render the content using individual React components, here is the query example.
{
  posts {
    nodes {
      title
      blocks {
        name
        innerBlocks {
          name
          saveContent
        }
        saveContent
      }
    }
  }
}

nextjs-wordpress-theme's People

Contributors

imranhsayed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.