Boilerplate used to build nearly-headless WordPress themes

Overview

Boilerplate for Nearly Headless WordPress Themes

This is a plugin boilerplate built using Underpin ,Nicholas, and AlpineJS. It will allow you to build a Nearly Headless WordPress theme, that allows you to run a WordPress website like a headless app, but also allows you to render specific pages using PHP instead of Javascript.

Want to learn more about this method? Check out my course here

Setup

To set this plugin up, follow these steps:

  1. Install composer packages composer install
  2. Install NPM packages npm i
  3. Compile NPM scripts npm run start or npm run build

Templates

Under the hood, this boilerplate uses Underpin's Template Loader for theme templating. Check out that library's readme file for documentation on how to create, and extend templates in this template.

Scripts

This boilerplate extends the Nicholas library to set up the interfaces needed to manage compatibility mode settings in the admin. Because of this, there are 3 scripts that get compiled. Check out that readme for more information on how to extend these scripts and customize them to suit your theme's needs.

  1. admin.js - Used to render the react app that displays the Nicholas settings screen located in Settings>> Nicholas Settings
  2. editor.js - Used to add the "compatibility mode" toggle to posts
  3. theme.js - The core functionality to handle the nearly headless approach.

Stylesheets

The default webpack config comes with Webpack's postCSS loader, and can handle SCSS and CSS files. You can override the default loader by adding a postcss file to this theme.

You might also like...
Zero-Config plugin to disable FLoC in your WordPress Website.
Zero-Config plugin to disable FLoC in your WordPress Website.

Disable FLoC by WP Munich A simple zero-config plugin to opt-out of Google FLoC. This plugin is made with love and brought to you by the folks of WP M

Wordpress plugin to allow websites to sell and distribute NFTs through the Enjin platform

MyMeta Basket is the world's first plug-and-play Wordpress/Enjin/Ethereum integration that allows you to start selling blockchain assets through your website within minutes. All you need is Wordpress, MyMeta Basket, and an Enjin subscription.

b5st – A Bootstrap 5 Starter Theme, for WordPress

b5st – A Bootstrap 5 Starter Theme, for WordPress Version 1.1 https://github.com/SimonPadbury/b5st b5st is a simple, Gutenberg-compatible WordPress st

酱茄企业官网小程序,酱茄专为中小企业开发的轻量级企业建站小程序(基于uni-app+wordpress),后台操作简单,维护方便,无需过多配置就能搭建一个企业小程序。
酱茄企业官网小程序,酱茄专为中小企业开发的轻量级企业建站小程序(基于uni-app+wordpress),后台操作简单,维护方便,无需过多配置就能搭建一个企业小程序。

一、小程序介绍 酱茄企业官网小程序,酱茄专为中小企业开发的轻量级企业建站小程序(基于uni-app + wordpress),后台操作简单,维护方便,无需过多配置就能搭建一个企业小程序。

Wrapping all composer vendor packages inside your own namespace. Intended for WordPress plugins

Wrapping all composer vendor packages inside your own namespace. Intended for WordPress plugins.

Sage is a productivity-driven WordPress starter theme with a modern development workflow.
Sage is a productivity-driven WordPress starter theme with a modern development workflow.

WordPress starter theme with a modern development workflow

Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure.
Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure.

WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure

Divide / Split your WordPress Blog visitors into 4 links by using Re-skinning URL splitter
Divide / Split your WordPress Blog visitors into 4 links by using Re-skinning URL splitter

Re-skinning URL splitter Tool Divide / Split your Wordpress Blog visitors into 4 links by using Re-skinning URL splitter Re-skinning URL Splitter Feat

Sensei LMS WordPress Plugin

Sensei LMS A learning management plugin for WordPress, which provides the smoothest platform for helping you teach anything. Sensei LMS is a commercia

Comments
  •  Fatal error: Uncaught Error: Class 'Underpin_Scripts\Loaders\Scripts' not found in...

    Fatal error: Uncaught Error: Class 'Underpin_Scripts\Loaders\Scripts' not found in...

    Hi there, I get this error when I try to activate the theme. " Fatal error: Uncaught Error: Class 'Underpin_Scripts\Loaders\Scripts' not found in /Volumes/.../wp-content/themes/nearly-headless-theme/vendor/underpin/underpin/lib/factories/Loader_Registry.php on line 43"

    Please note I've already ran composer install and npm install and then compiled using npm run start

    opened by zamanq 9
  • Removes cache worker and updates dependencies. #2

    Removes cache worker and updates dependencies. #2

    Resolves issue #2

    The cache worker was moved to the Nicholas app NPM package, so versions are bumped and the cache worker is updated to reference that instead of the original file that was in the boilerplate directly.

    opened by alexstandiford 0
  • Some fixes to get underpin 2.0 working with Nicholas 1.1

    Some fixes to get underpin 2.0 working with Nicholas 1.1

    After banging my head against the wall all day, I think I was able to finally get Nicholas 1.1 working with Underpin 2.0. It does not work out of the box and there appear to be a few show stoppers.

    In Nicholas.php

    1. I think you need the new ::logger Header seems to require: use Underpin\Loaders\Logger Replace the old logger with the new one (not sure if 100% necessary, though was causing errors with other underpin modules like the style loader):
    nicholas()->logger()->log_wp_error( 'error', $error, [
    			// 	'ref'     => $endpoint,
    			// 	'context' => 'endpoint',
    			// 	'params'  => $params,
    			// ] );
    

    With: Logger::log_wp_error( 'error', $error, [ 'ref' => $endpoint, 'context' => 'endpoint', 'params' => $params, ] );

    1. The rest endpoints need to have namespace updated to Rest not Rest_Endpoints: $this->rest_endpoints()->add( 'page_data', 'Nicholas\**Rest**\Page_Data' );
    2. Not sure, but perhaps use Underpin\Traits\Feature_Extension needs to be in the heade of Rest_Endpoing.php and/or in Nicholas.php? That seemed missing when testing a standard setup based of your demos on the rest_endpoint GitHub page and was throwing an error without it, though I'm not sure if it's required for Nicholas.

    Will see tomorrow if that was it or if more fixes required. Cheers.

    opened by josh-tt 2
Owner
Nicholas
Nicholas
A Simple and Lightweight WordPress Option Framework for Themes and Plugins

A Simple and Lightweight WordPress Option Framework for Themes and Plugins. Built in Object Oriented Programming paradigm with high number of custom fields and tons of options. Allows you to bring custom admin, metabox, taxonomy and customize settings to all of your pages, posts and categories. It's highly modern and advanced framework.

Codestar 241 Dec 23, 2022
Create WordPress themes with beautiful OOP code and the Twig Template Engine

Timber helps you create fully-customized WordPress themes faster with more sustainable code. With Timber, you write your HTML using the Twig Template Engine separate from your PHP files.

Timber 5.2k Dec 31, 2022
Add subtitles into your WordPress posts, pages, custom post types, and themes. No coding required.

Add subtitles into your WordPress posts, pages, custom post types, and themes. No coding required. Simply activate Subtitles and you're ready to go.

We Cobble 117 Dec 31, 2022
(Hard) Fork of WordPress Plugin Boilerplate, actively taking PRs and actively maintained. Following WordPress Coding Standards. With more features than the original.

Better WordPress Plugin Boilerplate This is a Hard Fork of the original WordPress Plugin Boilerplate. The Better WordPress Plugin Boilerplate actively

Beda Schmid 46 Dec 7, 2022
Manage your photos with Piwigo, a full featured open source photo gallery application for the web. Star us on Github! More than 200 plugins and themes available. Join us and contribute!

Manage your photo library. Piwigo is open source photo gallery software for the web. Designed for organisations, teams and individuals. The piwigo.org

Piwigo 2.3k Jan 1, 2023
YesWiki is a wiki system written in PHP, including extensions making collaboration more simple (databases, maps, easy editing, bootstrap themes,...).

YesWiki YesWiki is a Free Software under the AGPL licence, made for creating and managing your website, in a collaborative way. YesWiki allows any web

YesWiki 84 Dec 26, 2022
Typecho Themes,bestgril

bestgirl Typecho Themes,bestgirl主题 主题简介 bestgirl主题是一款简约风格的响应式轻主题,基于鹅厂熊大的出租本人创意域名展示页。 此主题适合日志、轻言、诗词、语录、格言、名句、条目、菜谱、记事本、大事记、回忆录等各种轻简短文字类网站。 主题预览 链接:http

null 38 Nov 14, 2022
A minimal boilerplate theme for WordPress using TailwindCSS, with PostCSS and Laravel Mix.

A minimal boilerplate theme for WordPress using TailwindCSS, with PostCSS and Laravel Mix.

Pixel Devs 74 Nov 25, 2022
A full-featured blog using Laravel 7.* & VueJS. Minimum library used

Blog Using Laravel 8 Let's keep it as simple as possible. Configure anything you want A full-featured blogging system for personal use.

Al Imran Ahmed 187 Sep 25, 2022
TYPO3 CMS extension which checks used CSS selectors in HTML output of the current page and removes CSS declarations which are unused.

EXT:css_coverage TYPO3 CMS extension which checks used CSS selectors in HTML output of the current page and removes CSS declarations which are unused.

Armin Vieweg 3 Apr 8, 2022