Code Monkey home page Code Monkey logo

headless-wordpress's Introduction

Headless Wordpress

An example of using wordpress as a headless CMS for publishing static JSON for apps and websites to consume.

Requirements

In order to run these code examples you will need the following:

Running

  • cd wordpress
  • docker-compose up
  • localhost:8000/wp-admin
    • user: root
    • pass: root
  • Party

WTF is going on?

Now that you've got the project running let's look at what is going on here.

Wordpress is an awesome platform, and for a while there ( and still today ) it's pretty widely used, the problem with wordpress and modern frontend development is that it can get bloated, slow, there are security issues, it can be a pain to configure, what ever reason you can imagine someone has an issue with it.

That said it's actually a pretty powerful platform when used right, in this example I am going to go over a bare bones approach to building a headless wordpress site that publishes to s3 as static JSON which can be consumed by your website, app, whatever you want.

Let's take a look at what this takes and how easy it can be to get something up and running and where we can take it.

The Guts

Let's check out the structure of our wordpress installation.

The first thing is that this is using Docker as a base the example wordpress install from my Dockerize All The Things This guide assumes you have knowledge of docker but it's not 100% required for doing something like this.

Wordpress

The install of Wordpress that we have is stripped down to only the essentials wich is just the admin and some base utils in a theme called headless. I've also removed all outbound scripts so there are no comments, no trackbacks, no signup, none of that - just the admin and a base theme.

In the plugins we have 4 plugins.

These plugins are the foundation to what we will be building. With these we will customize our wordpress install with some custom post types, fields and upload to s3 for consuming in your app / project.

Note that for this example I have created a plugin with these as dependencies but that you could roll your own version of something like this and we will cover that.

Check out the Medium Post To Learn More

headless-wordpress's People

Contributors

drewdahlman avatar

Watchers

James Cloos avatar Liam Nelson 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.