WP Advanced Block Theme
GitHub
  • Overview
  • Introduction
    • Requirements
    • Compatible theme
  • Technical guides
    • Theme specification file
    • Environment variables
    • Hooks
    • WP-CLI
  • Get started
    • Installation
    • Gutenberg blocks generation
Powered by GitBook
On this page
  • Back-end part
  • # Theme specification file
  • Front-end part
  • # Front-end code
  • # Frontspec (optionnal)
  • # Front-end views
  • # Front-end components use as Gutenberg Block
  1. Introduction

Compatible theme

WP Advanced Block Theme needs a compatible theme

Back-end part

# Theme specification file

Your theme has to have a JSON specification file which describes some behaviours used by "WP Advanced Block Theme" plugin.

Default location: themes/active_theme/theme_spec.json

View available properties


Front-end part

# Front-end code

PHP Constant: THEME_FRONT_END_RELATIVE_PATH

Your theme has to have a specific front-end directory.

Default location: themes/active_theme/front-end/

// Add this code in your wp-config.php file to override default value:
define('THEME_FRONT_END_RELATIVE_PATH', 'front-end');

# Frontspec (optionnal)

PHP Constant: THEME_FRONTSPEC_JSON_FILENAME

The front-end code inside your theme has to have its frontpec file, which works with the previous Theme specification file.

Default location: themes/active_theme/front-end/frontspec.json

// Add this code in your wp-config.php file to override default value:
define('THEME_FRONTSPEC_JSON_FILENAME', 'frontspec.json');

# Front-end views

PHP Constant: THEME_VIEW_ROOT_LOCATION

"WP Advanced Block Theme" plugin uses Twig Template Engine to render content. The front-end code inside your theme has to support Twig, and has to contain a sub-directory with views. Each view is a sub-directory with:

  • .twig file

  • viewspec JSON file

Default location: themes/active_theme/front-end/src/views/

// Add this code in your wp-config.php file to override default value:
define('THEME_VIEW_ROOT_LOCATION', 'src/views/');

# Front-end components use as Gutenberg Block

PHP Constant: COMPONENTS_RELATIVE_PATH

The front-end code inside your theme has to support Twig, and has to contain a sub-directory with views, and sub-directories for each components used as Gutenberg Block.

Default location: themes/active_theme/front-end/src/views/components/

// Add this code in your wp-config.php file to override default value:
define('COMPONENTS_RELATIVE_PATH', 'components/');

Last updated 1 year ago