Futurs
Any theme dependencies on functionality plugins should be built with the use of do_action(), apply_filters(), or function_exists().
do_action()
apply_filters()
function_exists()
In short, changing to the default theme should not trigger errors on a site. Nor should disabling a functionality plugin – every piece of code should be decoupled and use standard WordPress paradigms (hooks) for interacting with one another.
Theme file structure:
|- acf-json/ _____________________________ # Advanced Custom Fields |- assets/ | |- images/ ____________________________ # Theme images | |- fonts/ _____________________________ # Custom/hosted fonts | |- icons/ _____________________________ # SVG Icons | |- utility / ________________________ # Utility icons used throughout the theme | |- color / __________________________ # Color versions of utility icons | |- brand / __________________________ # Branded icons, often used in custom blocks | |- social / _________________________ # Social icons | |- js/ | |- src/ _____________________________ # Source JavaScript | |- global-min.js ____________________ # Concatenated and Minified JavaScript | |- editor.js ________________________ # JS for customizing the block editor | |- css/ | |- main.css _________________________ # Concatenated and Minified CSS | |- editor-style.css | |- scss/ ______________________________ # See below for details |- inc/ __________________________________ # PHP classes and files |- partials/ _____________________________ # Template parts | |- blocks/ ____________________________ # Custom blocks | |- post-summary/ ______________________ # Post summaries, for archive pages and post listing block |- templates/ ____________________________ # Page templates
The scss folder :
scss
|- assets/scss/ |-- modules/ # Common modules | |-- _helpers.scss # Helper mixins | ... | |-- partials/ # Partials | |-- _base.scss # global project variables + import modules and vendors | |-- _reset.scss # Reset | |-- _blocks-base.scss # Main style guide for the site | ... | |-- vendor/ # CSS or Sass from other projects | |-- _include-media.scss | ... | |-- main.scss # primary Sass file for frontend |-- editor-style.scss # styles that apply only to backend editor
How to structure a sass project ou sass boilerplate ou sitepoint ou different organisations
Le sass de srikat pour Genesis 27/05/2018
https://github.com/srikat/genesis-sample-sass
We’re using Advanced Custom Fields for custom blocks, site options, and metaboxes.
We are using the Local JSON feature for version control.
Field editing is disabled in production, but can be enabled in your local / development / staging environment by adding define( 'WP_LOCAL_DEV', true ); in wp-config.php
define( 'WP_LOCAL_DEV', true );
There’s no need to pull down all of the media from the production or staging environment.
BE_MEDIA_FROM_PRODUCTION_URL
define( 'BE_MEDIA_FROM_PRODUCTION_URL', 'https://sitename.com' );
Powered by BetterDocs