Download the PHP package k1sul1/wordpress-theme-base without Composer

On this page you can find all versions of the php package k1sul1/wordpress-theme-base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wordpress-theme-base

k1sul1/wordpress-theme-base

My idea of the perfect starting point for WordPress themes. Modern tooling in the frontend and utilities to keep you from repeating yourself.

I've shipped dozens of custom made WordPress sites and made a few of these starting points. None of them have been perfect, but this one works pretty damn well for me.

See also: k1sul1/docker-wordpress-spa-template for a local / production Docker environment with Let's Encrypt. It's built for single page applications but can be dumbed down by removing irrelevant services and configuration pieces.

Work in progress, forever.

Features

Hopefully just enough for you to build the next best WordPress site, without getting in your way. Everything from k1sul1/k1kit and a few cherries on top. See it for more detailed description.

Requirements

Recommendations

Install

Just dropping the folder works, but Composer is preferred.

You might have to add dev-master as version until I create a release.

Setup

Edit config.json to match your WordPress setup. Arguably not very hard. Run npm install.

To run webpack-dev-server (WDS), run npm run dev. To create a production build, run npm run build.

In webpack-dev-server, CSS should update automatically without reloading, as should any module.hot compatible code. React should work out of the box. Due to recent technological advancements configuration changes, it's now possible to run WDS "in the background". Previously you've had to open http://yoursite.local:8080 and develop in that, but that shouldn't be necessary any more. If it doesn't work, try :8080 and submit an issue.

It is possible to use /wp-admin through WDS, but there be dragons. Possibly. You can't fight the dragons, but you can go around them by ensuring that you're always using the admin through the correct domain and not through the proxy. There's a snippet in src/js/admin.js that you can uncomment to ensure you're always using it through the correct domain.

Help section

I don't want to use React

That's ok. Removing React from the bundles is easy with minor configuration modifications.

In .babelrc.js, comment out the following

In addition to that, you have to edit config/webpack.client.js, and change client in entries. Comment or remove react-hot-loader: client: [/* 'react-hot-loader/patch', */path.join(source, 'js', 'client')]

Now React won't be present.

On webpack-dev-server

WDS makes your life a lot easier, especially now that it can run in the background.

Previously, it had a few drawbacks / limitations / annoyances. Because it's a proxy server, it runs in a different origin, and that might cause CORS problems. These problems could be dealt with programmatically, but it was not unusual to see form submissions failing, etc.

It's perfectly fine to use this theme without using WDS, simply run npm run dev:noproxy instead of npm run dev.

Block creation

Create a file to blocks/. Name it whatever you want, just capitalize the first letter.

Then just add a new field group, like you normally would. Just select your block as the location.

Can I call the custom blocks manually?

Yes. The template files already do so. This example showcases how you can also cache those manually called blocks.

When calling manually, you have to make sure that you use the same datastructure as ACF.

I want to create Gutenberg blocks but I don't want to use ACF Blocks

Good luck. It's possible, but something that I'm not interested in supporting.

Create a new entry to config/webpack.client.js and start coding.

How to create a new entry to Webpack configuration?

Pretty easy. Edit the entry object in the configuration file of your choice.

Then create a file to src/js, in this case it's editor.js. If you want to generate a CSS file for the entry, import a CSS / Stylus file in it, just like in client.js.

After rebuilding or restarting the build, your new entry should be present in the generated asset manifest.

You don't have to include 'react-hot-loader/patch' in the entry, but it will not do any harm either.

How does HMR work?

With black magic. Once you understand that, it's pretty simple. CSS is stateless and easy to replace, but JavaScript is trickier. You explicitly have to declare something as hot reloadable, but this can be done with abstractions, such as react-hot-loader.

Adding HMR support to your own JS is "easy", simply add

to the relevant location.

New .styl files aren't built without restarting the build or modifying the file which imports the offending file

I'm pretty sure this issue is in stylus-loader, there's not much I can do about it. It's only imports with globs (*) that cause this issue.

Best not to use glob, until this issue is fixed, which is probably never. Unhelpful thread about the issue.


All versions of wordpress-theme-base with dependencies

PHP Build Version
Package Version
Requires squizlabs/php_codesniffer Version ^3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package k1sul1/wordpress-theme-base contains the following files

Loading the files please wait ....