Coder Social home page Coder Social logo

kalebheitzman / components Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.39 MB

A WordPress theme organized using a components pattern.

License: GNU General Public License v2.0

CSS 0.79% PHP 62.14% JavaScript 5.12% SCSS 31.95%
wordpress wordpress-theme components

components's Introduction

WordPress Components Theme

This is a minimalistic WordPress Skeleton/Base theme that follows a Components based system of organization heavily influenced by ReactJS. The design and development philosophy of this theme revolves around organizing your css, js, and php into component folders under the ui directory. View ./ui/site-navigation for an example of how scss, php, and js are organized together. You can use get_component( 'site-navigation' ) to call this from your main header.php template file for example.

Organize each component or building block of your site under the ui folder using the following sort of naming scheme.

ui/
  site-navigation/
    _site-navigation.scss
    site-navigation.php
    site-navigation.js

Initial Setup

This theme uses gulp and composer for development and production purposes. You'll need to run yarn install to install the needed dependencies for developing and to building your theme.

WordPress Coding Standards

This theme relies on the WordPress Coding standards to keep things nice and clean. Run composer install to install the standards and begin parsing your code. This project is setup to run on VS Code. It will be up to the user to use a different editor if they'd like. Be sure to install the phpcs extension if you use VS Code.

Custom Component Function

This theme includes a custom template loader to load components from the UI folder using the following syntax. You don't need to echo the function in your theme files in order for it to work.

get_componenent('component-name', 'component-partial');

A shorthand is avaiable by naming the component-name and component-partial the same thing. If the partial is unspecified, the component name is assumed to be the partial name.

get_component('site-header');

To load a sub component partial, specifiy the partial name. For example:

get_component('site-header', 'logo');

Styles

This theme has built in support for SASS compilation using gulp. Simply run gulp in your terminal and the default task will compile your styles automatically. Bundle individual .scss files inside each component subfolder and gulp will glob your files together under the main ui/styles.scss file.

Scripts

This theme will automatically load your js files if you follow the component structure. The included get_component function will search for a js file of the same name of the component and partial you pass and will automatically enqueue it into your site.

For example, if you were to call get_component( 'site-navigation` ), it would enqueue the ui/site-navigation/site-navigation.js if it exists.

Theme Features

This is a complete WordPress skeleton theme that includes multiple navigation menus, react-based Gutenberg Blocks, a custom theme panel, and more.

Primary Nav Menu

The Primary Nav Menu features a callout-button css class that can be added to menu items under Appearance -> Menus. This callout class highlights specified menu items to give them more visibility to clients visiting your site.

Social Nav Menu

The Social Nav Menu uses Fontawesome Icons to display social networks. For example, if you want to add a Facebook icon, you would add the fa-facebook css class to your menu item under Appearance -> Menus.

components's People

Contributors

dependabot[bot] avatar kalebheitzman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.