Skip to content

NathanHass/ml

Repository files navigation

Muzzy Lane Wordpress Theme

Getting Started

Running Wordpress Locally

There are several ways you can run Wordpress locally. I used VVV to set up my local environment.

VVV requires recent versions of both Vagrant and VirtualBox to be installed.

Vagrant is a “tool for building and distributing development environments”. It works with virtualization software such as VirtualBox to provide a virtual machine sandboxed from your local environment.

To set up configure a local environment with VVV, follow these instructions.

Front End Dependencies

First, make sure you have node installed. Node is a javascript application that serves as the backbone for bower (among other things). Download the installer for your operating system.

Next, install Bower. Bower is a package manager for front end dependencies. npm install -g bower

Next, install Gulp. This is used to compile the project’s SCSS. npm install —global gulp

Finally, open a terminal, navigate to your Muzzy Lane theme folder, and run the following commands. These:

$ bower install
$ npm install
$ gulp watch

Timber

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.

Continued development of this site will require a familiarity with Timber, Advanced Custom Fields (ACF), and the way they work together. Jared Novak, creator of Timber, has done a far better job than I could do documenting the intricacies of Timber, so I will link to his docs where appropriate.

Custom Twig File

Say you've created a page called “Authors” and WordPress has given it the slug authors.

  • Create a file called page-authors.twig inside your views and go crazy.
  • I recommend copying-and-pasting the contents of page.twig into here so you have something to work from.

Custom PHP Files

If you need to do something special for this page in PHP, you can use standard WordPress template hierarchy to gather and manipulate data for this page. In the above example, you would create a file called /wp-content/themes/ml/page-authors.php and populate it with the necessary PHP. Again, you can use the contents of the starter theme's page.php file as a guide.

Twig

Twig is a great template engine for PHP by the good folks at SensioLabs. To learn more about how to use it, check out the docs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published