EA Genesis Child theme

Theme (note in github) #

Any theme dependencies on functionality plugins should be built with the use of do_action()apply_filters(), or 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.

File Organization #

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 :

|- 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

SASS #

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

ACF #

Github :Advanced Custom Fields #

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

Core Functionality plugin #

BE Media from Production #

There’s no need to pull down all of the media from the production or staging environment.

  • Use the plugin : BE Media from Production to update all the image URLs to point to the production site.
  • In functions.php , define the BE_MEDIA_FROM_PRODUCTION_URL constant with the production or staging URL. This should match the source database you’re pulling from so all the media and image sizes in the database exist on the remote server.
define( 'BE_MEDIA_FROM_PRODUCTION_URL', 'https://sitename.com' );

#

Powered by BetterDocs