WordPress starter theme with a modern development stack for launching projects faster and easily.
- Create a new theme directory in wp-content/themes:
mkdir you-theme-dir && cd you-theme-dir
- Clone Starter Kit Theme:
git clone --depth=1 [email protected]:solidbunch/starter-kit-theme.git . && rm -rf .git
- Setup php dependencies:
composer install
- Setup node dependencies and dev mode build:
npm run install-dev
- Build minified assets for production:
npm run prod
- Build assets with source maps for development:
npm run dev
- Start watcher with browser sync for development:
npm run watch
Yarn commands
yarn
- setup node dependencies;yarn prod
- build minified assets;yarn dev
- build assets with source maps (for development);yarn watch
- start watcher;yarn browser-sync
- start watcher with browser sync;
── app/ # Main theme functionality files
├── Base/ # Base theme functions
│ ├──Hooks.php # Registering hooks
│ ├──Settings.php # Theme settings framework initialization
│ ├──Shortcode.php # Shortcode object configuration
│ └──ShortcodesManager.php # Register and load shortcodes
│
├── config/ # Base theme configuration
│ ├──_animations.php # CSS animations declaration
│ ├──_social_icons.php # Social CSS classes settings. Font Awesome default
│ ├──_social_profiles.php # Register social profiles meta for website options
│ └──config.php # Bootstrap config file
│
├── Handlers/ # Theme hook handlers, main functionality
│ ├──PostMeta/ # Registering meta fields for post types. Each file separately. Runs by Base/Hooks
│ ├──PostTypes/ # Registering custom post types with Taxonomies. Runs by Base/Hooks
│ ├──Settings/ #
│ │ └──ThemeSettings.php/ # Theme settings creation. Look in wp-admin Appearance/Theme Settings
│ ├──Backend.php # wp-admin functions
│ ├──Front.php # Basic Front handlers
│ ├──HTTP2.php # HTTP2 support
│ ├──LayoutGlobal.php # Builds global theme layout using actions
│ ├──LayoutSingle.php # Builds single post / page etc. layout using actions
│ ├──LazyLoad.php # Lazy load for images
│ ├──Menu.php # Menu registration hooks and methods
│ ├──OAuth.php # Oauth support
│ ├──Optimization.php # Removes unnecessary tags, performance optimization
│ ├──Security.php # Provides some security options. Disable xmlrpc, etc
│ ├──SetupTheme.php # Setup theme handlers
│ ├──VisualComposer.php # Rewrite default WPBakery Page Builder functions
│ └──VisualComposerExtends.php # Extend default functional of WPBakery Page Builder
│
├── Helper/ # Helpers classes
│ ├──ResponsiveImages/ # Modern responsive images with <picture> or <img>
│ ├──Assets.php # Helper to work with assets processed by webpack
│ ├──Front.php # Helper functions for templates and Front handler
│ ├──Media.php # Functions to help to output and resize media
│ ├──Utils.php # Other useful functions
│ └──View.php # Connect and output templates
│
├── Repository/ # Repositories, help to receive data from DB
│ └──*.php # Classes by each post type
│
├── Shortcodes/ # Shortcodes library (works with/without WPBakery Page Builder)
│ ├── alert/ # Alert block (icon, styling)
│ ├── button/ # Button element (icon, link, layout, styling)
│ ├── contact_form/ # Form and form elements (checkbox, email, file uploader, text, datepicker and other)
│ ├── google_map/ # Improved Google Map
│ ├── heading/ # Heading h1,h2,h3,h4,h5,h6 (font styling, layout)
│ ├── menu/ # Custom menu with desktop and mobile devices support
│ ├── news/ # News block
│ ├── posts/ # Posts block (pagination, styling)
│ ├── pricing_table/ # Pricing table (price settings, styling)
│ ├── social_login/ # Login using social networks Facebook, Twitter, Google
│ ├── tabs/ # Tabs shortcode
│ └── toggles/ # Accordion shortcode
│
├── templates/ # HTML or other templates
├── Widgets/ # Theme widgets
├── AbstractSingleton.php # Abstract Class for creating Singleton Classes
├── App.php # Application Singleton. Entrypoint
└── dev.php # Some developers functions for debug, logging, etc
── assets/ # Theme assets
├── css/
├── fonts/
├── images/
├── js/
└── libs/
── build/ # Webpack configs
── dist/ # The compiled assets
── template-parts/ # Front templates
── vendor-custom/ # Third-party development
├── aq_resizer/ # Resizes WordPress images on the fly
├── carbon-fields/ # Developer-oriented library for WordPress custom fields for all types of WordPress content
├── oauth/ # Facebook, Google, Twitter libs for OAuth
├── tgm/ # Required plugin installation
└── wp-bootstrap-navwalker/ # Make awesome bootstrap menu
── 404.php
── comments.php
── footer.php
── functions.php
── gulpfile.js
── header.php
── index.php
── package.json
── page.php
── page-tpl-no-sidebar.php
── postcss.config.js
── screenshot.png
── sidebar.php
── single.php
── style.css
── webpack.config.js
Gutenberg Blocks in the blocks/
folder are loaded with the autoloader. That is, you can simply create a folder of a new block with the necessary files and this blocks will be automatically available.
Use StarterBlock
as an example to create new blocks.
The file structure can be any, you can add your files, but here are three files config.php
, ajax.php
and shortcode.php
- loads by the autoloader.
── assets/ # All assets (styles, scripts, fonts, etc)
├── style.scss
├── scripts.js
└── images/
── childs/ # Nested shortcodes, have the same structure
── view/ # Shortcode templates
── ajax.php # Backend functions for ajax queries
── config.php # Shortcode config (required file)
── shortcode.php # Shortcode controller (required file)
── vc.php # WPBakery Page Builder support