Skip to content

steveariss/Axe

 
 

Repository files navigation

Axe

Axe is a simple bare bones WordPress starter structure. It is a theme meant to be a starting point to get you setup and running as fast as possible.

My build workflow might not be very orthodox but I typically review the design, Setup my Custom post types using Custom Post Type UI and setup any page data structures using ACF.

Simply being able to plow ahead creating my site structures and loading in real or fake content lets me have something tangible to work with.

Another tip that I can provide is using console.log to output my ACF structures reducing the need to be to refer back to the admin pages. Check it out here.

Build

Included is a blower file preset with Bootstrap SASS, jQuery and a couple other commonly used packages. Bower is going to download packages to /src/vendor.

The src folder stores your SASS and JS that should be compiled into /assets.

Use whatever build tool you want. A CodeKit file has been included to get up and running FAST. Gulp and Grunt are fine but do you really need it?

Home page

Placing a file under templates/content-home.php will resolve the home page and would be used by /

Page templates

Placing a file under templates/content-{slug}.php will resolve the home page. Using content-contact.php would be used by /contact

Sub Page templates

Placing a file under templates/sub-{parent_slug}.php will resolve the home page. Using sub-services.php would be used by all pages under service like /services/design

Post format templates

Placing a file under templates/format-video.php will resolve all video formats.

Custom Post Type templates

Placing a file under templates/single-books.php will resolve all custom post type single posts.

Custom Taxonomies

Placing a file under templates/archive-books.php will resolve a custom taxonomy for Books /books/sci-fi/ also using a custom loop. The default archive would be archive-default.php using the default post loop.

Custom Loops

If you have a custom post type called Books, creating content-books.php and loading a custom loop like loop-books.php with all the necessary "Loop" code would give you your custom book loop.

See loop-post.php for an example.

Helper Functions

mix() - Allows you to use Laravel Mix with WordPress read more here

get_template_part_acf() - Works exactly like get_template_part() except that it uses an include making it more suitable to use with ACF. You can include your custom content once which is already done for you. Have a look here.

is_sub_page() - Used to determine if you are on a sub page.

__t() - Returns the template directory, It should be noted that this is easily over written in the child theme.

__a()- Returns the assets relative to the template directory. /assets/

__j() - Prints the JS path. /assets/js/

__i() - Prints the Images path /assets/img/

__c() - Prints the CSS path /assets/css/

__v() - Prints the Vendor path (Bower, other libraries) /assets/vendor/

__lib($path) - Returns the lib path (custom theme classes like Navigation walkers)/lib/

__m() - Returns the mix-manifest.json file path.

__video() - Echos the video path. /assets/video/

Functions in the parent theme should be wrapped with function_exists extend the child theme and prevent any conflicts.

Style

@import "components/base-variables";
@import "components/bootstrap-variables";
@import "components/bootstrap-custom";

Since loading Bootstrap from the vendor folder means you can't modify your variables without risk over overwriting them, A copy has been made in the /src folder.

base-variables houses any site specific variables that you might need.

bootstrap-custom allows you to easily comment out any unused Bootstrap code that you wont be using. This lets you output a more minimal css file.

Structure

Another helpful inclusion is the _structure.scss file which gives you 5px incremental adjustments to padding and margins through out HTML.

For example:

<div class="p-top-50 p-sm-top-15 m-30"></div>

This would result in a 50px padding for everything except small where you would end up with a 15px top padding. This div would also have a margin of 30 on all sides.

Child theme

https://github.com/adampatterson/Handle

If you will be using ACF with your child theme uncomment the following so that ACF will store the .json files in your working Child theme.

Opening theme-helpers.php and uncommenting the function on line 6 would allows the child theme to serve all of your themes assets.

Credits

Template tags are heavily modified versions of _S

Disclaimer

This theme is made for Me, and with my efficiencies in mind. That said, If you have anything to add then send me an email hello@adampatterson.ca

About

Axe is a simple bare bones WordPress starter theme for Developers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 65.1%
  • PHP 33.5%
  • Other 1.4%