Running Nearly Headless WordPress in Dev Mode

Running Nearly Headless WordPress in Dev Mode

I ran into “Nearly Headless WordPress” by accident while researching headless WordPress. The aim is to combine the best of both headless WordPress and normal WordPress. I was interested and quickly installed it on a Local-WP site on my local machine, (this tutorial follows that installation process) the boilerplate template is just that and it seems development on the project has paused, however it is an interesting idea with some potential. I highly recommend that you read this article here by the developer who made it, it explains in great detail what Nearly Headless WordPress is and how it works: https://css-tricks.com/how-to-build-a-nearly-headless-wordpress-website/  With that let’s dive into this tutorial and install Nearly Headless WordPress on a test site! 

Official github repo: https://github.com/nicholas-wordpress/nearly-headless-theme

Dependencies

Nearly Headless WordPress runs as a theme for your WordPress site, as such it requires that you have WordPress installed and running. I used Local WP to run a test site. You can get Local WP here: https://localwp.com/ Besides WordPress, Nearly Headless WordPress requires composer, node.js, and npm to be installed. I will cover installing these dependencies on Ubuntu in this tutorial. 

Installing Composer on Ubuntu

To install composer on Ubuntu: 

							
							
					sudo apt install composer				
			

Installing Node.js and NPM on Ubuntu

To install npm and nodejs on Ubuntu: 

							
							
					sudo apt install nodejs npm				
			

Launching Nearly Headless WordPress

First off we need to navigate to the themes directory of our WordPress install located at: path/to/wordpress/wp-content/themes from here we will clone the Nearly Headless WordPress Github Repo via to our local machine via: 

							
							
					git clone https://github.com/nicholas-wordpress/nearly-headless-theme.git
				
			

From here we need to navigate into the nearly-headless-theme directory and run the installation.

							
							
					cd nearly-headless-theme
composer install
npm i    # or npm install
npm run start    # or npm run build
				
			

Finally in your WordPress dashboard go to themes and select “Nearly Headless Theme”.

That’s a wrap! Thanks for reading!

Walter Miely is a tech entrepreneur and CEO of Phoenix Ignited Tech You can find him on Linkedin. This material is licensed under the CC BY 4.0 License LEGAL DISCLAIMER: The content provided here is provided AS IS, and part of, or the entirety of this content may be incorrect. Please read the entireLegal Disclaimer here.