Create Block Theme

Description

Cette extension vous permet de :

  • Create a blank theme
  • Create a new theme based on the currently active theme
  • Create a child theme of the active parent theme
  • Create a new style variation
  • Export a theme
  • Save user changed templates and styles to the active theme

All newly created themes or style variations will include changes made within the WordPress Editor.

This plugin also makes several changes to the contents of a theme, including:

  • Adds all images used in templates to the theme’s assets folder.
  • Ensures the block markup used in templates and patterns is export-ready.
  • Ensures most strings used in templates and patterns are translate-ready.

L’extension est uniquement destinée au développement – elle n’est pas destinée à être utilisée sur des sites de production, mais comme outil pour créer de nouveaux thèmes.

Étape 1 – Configuration

Installez et activez l’extension Create Block Theme.

There will be a new panel accessible from the WordPress Editor, which you can open by clicking on a new icon to the right of the « Save » button, at the top of the Editor.

  1. Create Block Theme panel in the WordPress Editor

Étape 2 – Personnalisation du style

Make changes to your site styles, fonts and templates using the Editor.

Étape 3 – Exportation

Still in the WordPress Editor, navigate to the Create Block Theme menu at the top of the Editor.

To save recent changes made in the Editor to the currently active theme:

  • Select « Save Changes » to save any recent changes to the currently active theme.
  1. Create Block Theme save panel in the WordPress Editor

To install and uninstall fonts:

  • Install and activate a font from any source using the WordPress Font Library.
  • Select « Save Changes To Theme » and select « Save Fonts » to save all of the active fonts to the currently active theme. These fonts will then be activated in the theme and deactivated in the system (and may be safely deleted from the system).
  • Any fonts that are installed in the theme that have been deactivated with the WordPress Font Library will be removed from the theme.

or export the theme:

  • Select « Export Zip » to export the theme as a zip file.

To edit the theme metadata:

  • Select « Edit Theme Metadata » to edit the metadata for the theme. These details will be used in the style.css file.
  1. Theme Metadata editing panel in the WordPress Editor

To inspect the active theme’s theme.json contents:

  • Select « Inspect Theme JSON »
  1. theme.json inspector in the WordPress Editor

To create a new blank theme:

  • Select « Create Blank Theme »
  • Supply a name for the new theme (and optional additional Metadata)
  • Click « Create Blank Theme »

To create a variation:

  • Select « Create Theme Variation »
  • Provide a name for the new Variation
  • Click « Create Theme Variation »

To create a new Clone of the current theme or to create a Child of the current theme:ons for the currently active theme:

  • Click « Create Theme »
  • Click « Clone Theme » to create a new Theme based on the active theme with your changes
  • Click « Create Child Theme » to create a new Child Theme with the active theme as a parent with your changes
  1. Create Theme panel 1 in the WordPress Editor

  2. Create Theme panel 2 in the WordPress Editor

Many of these options are also available under the older, deprecated Create Block Theme page under Appearance > Create Block Theme.

  1. Page under Appearance > Create Block Theme

Dépannage général

Si vous rencontrez des problèmes, veuillez essayer ce qui suit :

  • Assurez-vous que la dernière version de WordPress est installée.
  • Assurez-vous que la dernière version de l’extension est installée.
  • Désactivez toutes les extensions et voyez si cela résout le problème. Si cela fonctionne, réactivez les extensions une par une jusqu’à ce que vous trouviez le(s) extension(s) qui pose(nt) problème.
  • Remplacez le thème par le thème par défaut afin d’écarter tout problème lié au thème.
  • Consultez le forum de support pour des problèmes similaires.

J’obtiens un fichier zip corrompu lorsque j’exporte mon thème.

  • Suivez d’abord les étapes générales de dépannage ci-dessus.
  • Assurez-vous que les préférences WP_DEBUG de votre fichier wp-config.php sont réglées sur false de cette manière : define( 'WP_DEBUG', false );.
  • Si votre thème contient des fichiers PHP, vérifiez que ces fichiers n’utilisent pas des balises fermantes PHP ?> en fin de fichier. Si c’est le cas, retirez ces balises fermantes.

FAQ

Comment obtenir de l’aide ?

Si vous rencontrez un problème, consultez d’abord le Forum d’assistance. Le forum est un endroit idéal pour obtenir de l’aide.

Comment signaler un problème ?

Si vous avez un bogue à signaler, veuillez l’envoyer au dépôt Dépôt GitHub en tant que problème. Veuillez rechercher avant de créer un nouveau bogue afin de vous assurer qu’il ne s’agit pas d’un doublon.

Avis

25 février 2024
Wow, 2 days of work completely gone! In the end I edited the "theme info", hit "saved changes" and *poof*, all gone.
14 février 2024
One thing that I would improve:When you open the assets/fonts folder of TT3 or TT4 themes, they offer .woff2 but the same doesn't happen with this plugin. So when you add a Google font it is only adding the .ttf font format, which is a very old format.
12 janvier 2024
Thanks for this. It works well. It's exciting that block theme design is low code. This plugin makes it even more low code.
10 juin 2023 1 réponse
Works well with the built-in theme editor. Its a shame the theme editor itself is not better.
2 juin 2023
This is essential for theme devs. Or anyone working with child themes.
20 mai 2023
I love this. In just about a blink of the eye, I can create my own custom version of an already-built theme. Sweet!
Lire les 27 avis

Contributeurs/contributrices & développeurs/développeuses

« Create Block Theme » est un logiciel libre. Les personnes suivantes ont contribué à cette extension.

Contributeurs

“Create Block Theme” a été traduit dans 15 locales. Remerciez l’équipe de traduction pour ses contributions.

Traduisez « Create Block Theme » dans votre langue.

Le développement vous intéresse ?

Parcourir le code, consulter le SVN dépôt, ou s’inscrire au journal de développement par RSS.

Journal

2.1.0

  • Save only templates that have been changed (#572)
  • I18n: Make modal titles translatable (#575)
  • Update readme with changes from UI changes and updated screenshots (#571)
  • Fix concatenation of translation strings (#554)
  • Include activated Fonts on theme zip export functions (#564)
  • Fix/un transposed patterns (#567)
  • Try/refactor editor UI (#563)
  • Update readme files with editor-specific steps and screenshot references (#555)

2.0.2

  • Update readme, remove test files from release build (#548)

2.0.1

  • Add missing build step to deploy workflow (#546)

2.0.0

  • Remove reviewer addition (#544)
  • Refactor GitHub release workflows (#542)
  • Fix changelog creation script (#541)
  • Add theme json inspector (#520)
  • Add deprecation notice in theme export admin screen (#540)
  • Replace font management with screen pointing to native font library (#539)
  • Added creation of theme validation to site editor interface (#532)
  • Add/child theme creation (#531)
  • Add blueprint.json file to enable plugin previews (#511)
  • Extracted any logic that may need to be tested from the api class (#522)
  • Use CORE for Font Management (#518)
  • Add integration tests (#393)
  • Remove CODE_OF_CONDUCT.md from .distignore. (#515)
  • Remove repo specific CoC. (#514)
  • GitHub Actions: Add JavaScript Unit Test (#508)
  • Add files and directories not needed for release to .distignore (#512)
  • Replace dash icon with SVG icon (#506)
  • Fix browser warning error when clicking the reset button (#505)
  • Add markdown and package.json lint command (#504)
  • Fix react warning error on font upload page (#502)
  • Fix dynamic property deprecation (#501)
  • Add text domain to translation target (#499)

1.13.8

1.13.7

1.13.6

1.13.5

  • Make form files more specific to form page
  • Set page titles that set only within CBT

1.13.4

  • Bump « tested up to » to 6.4
  • Update Google Fonts JSON data from API
  • Update theme form markup and styles
  • Fix/child export
  • Corrects malformed input tag
  • Add quotes to font family names

1.13.3

  • Mise à jour de « Testée jusqu’à » la version 6.3
  • Add .wp-env.override.json to .gitignore
  • Use wp_add_inline_script for createBlockTheme object
  • Update Google Fonts JSON data from API
  • Mise à jour de « nécessite la version PHP » 7.4
  • Fix PHP 8.1 errors caused by missing page titles

1.13.2

  • Update Google Fonts JSON data from API
  • Set the initial version to 1.0.0 instead of 0.0.1
  • Fix: react render warning
  • Introduce basic wp-env environment

1.13.1

  • Add default value for recommended plugins section
  • Update Google Fonts JSON data from API

1.13.0

  • # Conflicts:

admin/create-theme/theme-readme.php

admin/create-theme/theme-zip.php

  • Fusionner la branche « trunk » dans fix/resources-credits-on-save
  • Fusionner la branche « trunk » dans add/subfolder-to-zip
  • Conserver les informations de copyright lors de la création d’un nouveau thème.
  • Update Google Fonts JSON data from API
  • Déplacer la vérification de download_url vers le haut
  • Évitez les espaces ou autres caractères étranges dans les chemins d’accès aux ressources de police de caractère.
  • Fusionner la branche « trunk » dans add/subfolder-to-zip
  • Ajouter des fichiers au sous-dossier zip appelé comme slug du thème
  • Update Google Fonts JSON data from API

1.12.1

  • Corriger un double remplacement dans replace_namespace

1.12.0

  • # Conflicts:

src/plugin-sidebar.js

  • Ajouter une entrée de crédits d’image
  • Mettre à jour la logique version du thème pour utiliser isset()
  • Update Google Fonts JSON data from API

1.11.0

  • Update Google Fonts JSON data from API
  • Add linebreaks before hyphen lists in readme to fix plugin repository display
  • Empêcher une espace blanche supplémentaire dans les crédits de police dans readme.txt
  • Polices Google : remplacer les gestionnaires onClick par onChange
  • Fusionner la pull request #374 de WordPress/fix/escape-template-text
  • Mettez à jour la version requise du nœud et mettez à jour les dépendances

1.10.0

  • Update Google Fonts JSON data from API
  • Ajout de FAQs de dépannage
  • Mise à jour du champ « Nécessite au moins » des thèmes générés
  • Améliorer la gestion des erreurs de licence de police
  • Corriger la propriété tabIndex
  • Ajouter automatiquement les informations de licence de police pour les polices locales

1.9.0

  • Fusionner la branche « trunk » dans add/handle-google-font-credits
  • Update Google Fonts JSON data from API
  • Corriger une erreur de console dans la fonction prepareThemeNameValidation
  • Ajouter une section FAQ au fichier readme.txt
  • Ajouter automatiquement les informations de licence de police pour les polices Google
  • Supression du lien de donation

1.8.2

  • Fusionner la branche « trunk » dans update/tested-up-wp-version-62
  • Mise à jour testée jusqu’à : version 6.2 de WordPress
  • correction de la duplication d’étiquettes dans le thème exporté
  • Corriger la vérification des erreurs
  • Update Google Fonts JSON data from API
  • Remanier le code de l’application React pour un usage général
  • ajouter le répertoire de construction à la liste d’exclusion de php
  • Ne pas appeler replace_template_namespace lors de l’écrasement du thème
  • Merge branch ‘trunk’ into fix/314
  • Corriger une erreur lors du passage en mode modification de modèle dans l’éditeur de publication
  • Ajouter useRootPaddingAwareAlignments à un thème vierge
  • Update Google Fonts JSON data from API
  • Merge branch ‘trunk’ into fix/314
  • Évitez d’ajouter les informations de modèle à style.css s’il est vide
  • Corriger la suppression du chemin famille-de-caractère/police lorsque le nom de la police est différent de celui la famille
  • Ajouter la validation du nom du thème
  • Corriger le thème exporté par l’éditeur de site
  • Supprimer les caractères d’échappement avant d’imprimer la feuille de style
  • Linting unlinted file

1.8.1

  • Add current WordPress version to style.css and readme.txt
  • Add labels around Google font family checkbox controls
  • Fix theme slug, textdomain, and template for cloned, child and sibling themes.
  • Remplacer le slug du thème dans les modèles après en avoir obtenu les URL multimédias

1.8.0

  • Export style variations just with the changes made by the user
  • fix issue where package-lock is not updated on version bump
  • Adding default value to an to avoid error when calling export_theme_data()
  • Fixing image downloading not working in some cases
  • Update Google Fonts JSON data from API
  • Add Export (Clone) to site editor

1.7.1

  • Update screenshots
  • Fix manage fonts UI and backend when no settings are defined in theme.json
  • Variable font weight range

1.7.0

  • Manage fonts minor refactor. Move elements from PHP to react
  • Allow otf font file upload
  • Local fonts section implementation in React
  • Fonts outline sidebar
  • Update Google Fonts JSON data from API

1.6.3

  • (Fix refactor regression) Remove white spaces from theme slug

1.6.2

  • Refactor font-management class
  • Refactor create-block-theme class
  • fix manage theme font menu casing
  • Add phpcs exception to avoid PHP8.0 incompatibility errors
  • Fix blank theme screenshot fatal error
  • Fix lint issues using auto fixer tool
  • Update Google Fonts JSON data from API
  • Fix CSS lint issues
  • Fix PHP lint issues
  • Fix JS lint issues
  • Add lint validation to PR workflows
  • fix package lock sync issue

1.6.1

  • Add: input for theme tags
  • Placeholder URL change to TT3
  • Remove white spaces from theme slugs

1.6.0

  • Update main readme and add supporting docs
  • Fix Depreciation Warning
  • Cleanup Manage Theme Fonts UI
  • Bundle template images into theme assets and make their urls relative
  • Cloned themes: Add original theme name to readme.txt and style.css
  • Font families collapsed by default
  • Fix: Unexpected action when clicking Collapse chevron
  • Lint all CSS files
  • Fix: composer scripts doesn’t work on Windows
  • Use Gutenberg Theme JSON resolver if its available
  • Update Google Fonts JSON data from API
  • Replacing mkdir() calls with WordPress wp_mkdir_p() function

1.5.1

  • check for DISALLOW_FILE_EDIT and simplify permission check logic
  • Load google fonts data from url
  • Separate styles and templates reset
  • Add spinner while google fonts load instead of showing a blank page
  • Add: code linting scripts
  • Update Google Fonts JSON data from API
  • Avoid pre commit verifications on Github actions to prevent action errors caused by linting problems

1.5.0

  • Fix: browser console errors
  • Fix: Adding or removing fonts fails in some Windows environments
  • Add placeholder screenshot to boilerplate theme
  • Refactor: Add Google Fonts section from vanilla JS to React app
  • Adding demo text settings

1.4.0

  • Specify node and npm versions, add nvmrc file
  • Add theme screenshot uploading
  • Manage fonts: Demo text editable
  • Update Google Fonts JSON data from API

1.3.10

  • Remove font face: avoid unwanted removal of fontfamily.
  • Add missing spaces to option labels

1.3.9

  • Updating Tested up to: 6.1
  • I18N: Some new UI strings are not translatable
  • Replace « current theme » with « active theme » (or « currently active theme »)
  • Improve translation process by removing trailing spaces
  • Fonts: remove font files from theme assets folder if the font face/family is removed.
  • Refactor to read raw theme.json data instead of using core methods
  • Update Google Fonts JSON data from API

1.3.8

  • Fixes the spelling of definition
  • Fixing readme contributors
  • Add contributor username to readme
  • Update GitHub action to avoid deprecation warning
  • Update Google Fonts JSON data from API
  • Update Google Fonts JSON data from API
  • Check permission before running functions that need file write permissions
  • Allow previewing system font

1.3.7

  • Moving assets files to be auto updated by the release action

1.3.6

  • Auto update assets using a github action

1.3.5

  • Auto release: commit updated php file with the new version

1.3.4

  • auto update version of php file

1.3.3

  • Automatic release improvements

1.3.2

  • Automatic release improvements

1.3.1

  • Mettre à jour .distignore

1.3.0

  • Mettre à jour les données des polices Google
  • Force https to load Google fonts preview
  • Add the ability to select/unselect all google font variants
  • Merge branch ‘trunk’ into try/manage-fonts
  • Update google fonts JSON data automatically using a repo action
  • Merge branch ‘trunk’ into release-action
  • Merge branch ‘trunk’ into try/manage-fonts
  • Merge branch ‘try/manage-fonts’ into release-action
  • Manage theme fonts
  • Automate release: build, version bump, changelog, deploy to wp.org
  • Automate release

1.2.3

  • Add translation domain (#121)
  • Check for nonce index (#120)
  • Validating mime type of font file on server side (#119)

1.2.2

  • Add capabilities and nonce checks (#118)

1.2.1

  • Corriger le numéro de version

1.2.0

  • Embed Google fonts and local font files in theme (#113)
  • Change button text (#112)
  • Add check and directory creation for template and parts folders. (#110)
  • Change theme.json schema of blank theme if Gutenberg isn’t installed. (#107)

1.1.3

  • update links, screenshots of the new changes (#97)
  • Add $schema and use Gutenberg classes (#99)
  • Update readme to include latest features (#100)
  • Generate $schema URL in the same way as core. (#105)

1.1.2

  • Save a theme variation (#90)
  • Make UI string ‘Create Block Theme’ can be translatable (#92)

1.0.1

  • Add option to create blank theme. (#70)
  • Improve form instructions (#76)
  • Form cleanup and Theme name check (#77)
  • Get the correct merged theme.json data (#88)

1.0

  • Version initiale.