Git Product home page Git Product logo

headless-wordpress-theme's Introduction

Headless WordPress Theme

Theme to use when WordPress is being used as a headless CMS.

Overview

This theme provides these things:

  1. A blank style.css file (required for any WP theme) and a theme screenshot of the WP logo
  2. A functions.php file that contains a single function for redirecting requests for frontend WP pages to the decoupled frontend app
  3. An index.php file that renders out a link to the wp-admin as a fallback, if the redirect described in #2 has not been set up

This theme does not provide any templates or styles, since it is meant to be used for headless setups.

Getting Started

Install and activate, just as you would any WP theme Define a FRONTEND_APP_URL constant in your project (wp-config.php usually works best), specifying where the frontend app lives, like this:

define( 'FRONTEND_APP_URL', 'https://example.com' );

Once you define this constant, requests to frontend WP pages will be redirected to the decoupled frontend app URL. If you do not define it, then for all requests to frontend WP pages, a <site title> admin link will be rendered out that points to the wp-admin.

headless-wordpress-theme's People

Contributors

kellenmace 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.