Hi
I have created a child theme and that went well. I have altered style and theme.json and I have added functions and screenshot. And now I am confused… very:
I have this in index template:
<!-- wp:template-part {"slug":"footer","area":"footer"} /-->
and this in original TT4 index:
<!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer"} /-->
Why the difference? Where can I find slug to my footer? that is a template part and why is it not updated here, since I create a child from TT4 where this was correct? Why can I not see it when I see it in editor?
My current theme.json child is like so:
{
"$schema": "https://schemas.wp.org/wp/6.6/theme.json",
"version": 3,
"patterns": [],
"settings": {
"color": {
"palette": [
{
"name": "Black",
"slug": "black",
"color": "#000000"
},
{
"name": "White",
"slug": "white",
"color": "#ffffff"
},
{
"name": "Draupnir 8",
"slug": "draupnir-8",
"color": "#171717"
},
{
"name": "Draupnir 9",
"slug": "draupnir-9",
"color": "#ae1100"
}
]
}
}
"styles": {
"blocks": {
"core/button": {
"variations": {
"outline": {
"spacing": {
"padding": {
"bottom": "calc(0.6rem - 1px)",
"left": "calc(1rem - 1px)",
"right": "calc(1rem - 1px)",
"top": "calc(0.6rem - 1px)"
}
},
"border": {
"width": "1px"
}
}
}
},
"core/buttons": {
"spacing": {
"blockGap": "0.7rem"
}
},
"core/search": {
"css": "& .wp-block-search__input{border-radius:.33rem}",
"typography": {
"fontSize": "var(--wp--preset--font-size--small)"
},
"elements": {
"button": {
"border": {
"radius": { "ref": "styles.elements.button.border.radius" }
}
}
}
},
"color": {},
"elements": {
"button": {
":active": {
"color": {
"background": "var(--wp--preset--color--contrast)",
"text": "var(--wp--preset--color--base)"
}
},
":focus": {
"color": {
"background": "var(--wp--preset--color--contrast-2)",
"text": "var(--wp--preset--color--base)"
},
"outline": {
"color": "var(--wp--preset--color--contrast)",
"offset": "2px"
},
"border": {
"color": "var(--wp--preset--color--contrast-2)"
}
},
":hover": {
"color": {
"background": "var(--wp--preset--color--contrast-2)",
"text": "var(--wp--preset--color--base)"
},
"border": {
"color": "var(--wp--preset--color--contrast-2)"
}
},
"border": {
"radius": ".33rem",
"color": "var(--wp--preset--color--contrast)"
},
"color": {
"background": "var(--wp--preset--color--contrast)",
"text": "var(--wp--preset--color--base)"
},
"spacing": {
"padding": {
"bottom": "0.6rem",
"left": "1rem",
"right": "1rem",
"top": "0.6rem"
}
},
"typography": {
"fontSize": "var(--wp--preset--font-size--small)",
"fontStyle": "normal",
"fontWeight": "500"
}
},
},
},
"templateParts": [],
"customTemplates": []
}
Functions:
I am adding this to my functions cause I read in manuals I must. Why does WP themes not handle this default and is code correct?
/**
* Theme WordPress default does not enque the mother theme, when creating a child,
* hence, we call both the child as well as the mother themes
*/
add_action( 'wp_enqueue_scripts', 'draupnir_9_enqueue_styles' );
function draupnir_9_enqueue_styles() {
wp_enqueue_style(
'draupnir-9-parent-style',
get_parent_theme_file_uri( 'style.css' )
);
}
Thx – I need help, please
]]>In a video on theme development, for create block them it states,
“Create Block Theme Plugin Options
The Create Block Theme plugin has been developed by the Makewww.ads-software.com community. An important aspect of this plugin before you get started is to note that it is meant for development only and is not intended for use on a production website.”
How do I take what I’ve done on my development site and move it to my live site? Any specific tests or gotcha’s I should be aware of before pushing my changes to my live site?
What’s the best approach for the migration?
Ronald
I have made some custom templates for single posts within a specific category. The templates also have a query loop with a filter for that same category, so visitors can easily go to the next similar post. But when I save the theme, the category filters are removed. The template shows all posts.
Steps:
WordPress: 6.6.2, Create Block Theme: 2.5.0
]]>Currently struggling a bit to understand how font management is supposed to work, as some fonts I downloaded / installed locally in Appearance > Editor > Styles > Typography > Fonts were installed in ~/wp-content/uploads/fonts/ (using some weird filenames), and some fonts are installed and used in ~/wp-content/themes/mytheme/assets/fonts/ (using font names as file names).
All of the fonts are used in the theme, all of them are listed under “Installed Fonts” (none active) and “Theme Fonts”.
When I use Create Block Theme to write my changes to the theme files and open theme.json, some fonts use e.g. “src”: “https://mysite.test/wp-content/uploads/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4iY1M2xLER.woff2”, while others use the much more portable
“src”: [
“file:./assets/fonts/fuggles/fuggles-400-normal.woff2”
]
Is there a way to get all fonts to be copied to Theme/assets/fonts and use the relative pathname besides deleting the “Installed Fonts” and re-installing the same fonts?
Thanks for an incredibly useful plugin, which is getting even better with each release, by the way!
Good day, I am following an old tutorial on creating a new block theme by installing “Create Block Theme Plugin” which should add the option “Manage Theme Fonts” under appearance but it does not appear, when I checked the version of “Create Block Theme” is 1.13.2 but the latest is 2.4.0.
Has this been removed or where do I find “Manage Theme Fonts”
Thanks
]]>Hey!
Today I worked on a client project. As I wanted the feature to fix groups sticky I added it via the theme.json.
"position": {
"sticky": true
},
After that I reload the site editor and could use the settings.
After editing other settings inside the site editor I saved the changes and then exported them to the child theme via “save to theme” inside the “create block theme” sidebar.
The other changes have been transferred successful to the theme.json. Only the position: sticky setting is missing from the exported JSON.
The theme.json has version 3.
Greetings
derRALF
Hey!
I have a feature idea to help people with website projects using version control or in general prefers to manage there theme styling using files.
If a child theme is active, an option to activate a auto-save mode would be great. That way users can use the site editor and the file editor at the same time.
Not sure if it should be a checkbox or a toggle between “DB-mode”/”file-mode” as a save target.
This would also be helpful to work with multisites. For example for multilingual websites that share a design the admin can work on the styling and templates and automatically the changes apply to all languages.
Also this would close the gap between people used to the classic way of managing themes via files and using block themes. Specially the html-templates with all the comments are very hard to do via code.
Greetings
derRALF
PHP Fatal error: Uncaught TypeError: ZipArchive::addFile(): Argument #1 ($filepath) must be of type string, WP_Error given in C:\Users\<omitted>\LocalSites\<omitted>\wp-content\plugins\create-block-theme\includes\create-theme\cbt-zip-archive.php:25
When trying to export zip in the editor. When trying from the launch screen nothing happens, but the error is the same. PHP 8.1.23 w/ php_zip.dll (zip) support.
]]>Using the Create Block Theme plugin I want to export my theme changes to TT4, such as global styles made inside the WordPress Editor or custom templates.
I don’t want to create a child theme. What would happen if I selected “download zip” and used it on another site to override the theme? Will I lose my customizations if there is a theme update?
Also, what would happen if I select to save my changes to the theme? Will those customizations load faster? Will those changes will be lost with theme updates?
Thanks so much.
]]>Hello!
Is updating to v3 in the works? I noticed this plugin is still outputting v2 even though it references 6.6 in the schema link it outputs
]]>I am having a strange error where after I’m done working on a template design within the editor I go to use the ‘save changes to theme’ option so that I can apply them to the theme folder. But then it just completely wipes it and shows a blank template page with a ‘Pattern Placeholder’.
I’m at a loss as to why it does this, but I suspect it could be related to the starter theme I went with. I’ve tried across multiple instances of WordPress and still end up with the same issue. https://en-nz.www.ads-software.com/themes/blockstarter/ is the starter theme.
]]>Hi,
I created a new theme with the plugin Create Block Theme
I set to Style – Layout – Dimensions
CONTENT =600px
WIDE = 1300px
And now the problem.
When I edit a page, I can set Align – Wide and in the Editor part the created section is wider, but in the front-end the created section is only 600px. normally it should have 1300px.
I think it’s a bug, or do I have to do something else?
]]>How to delete a (style combination) directly with the plugin (Create Block Theme) without going to my web server Control Panel?
is there any way to do that? if not, please add that future to the plugin
Bonjour,
Depuis la mise a jour de WP 6.5.5, il n’est plus possible d’accéder à l’éditeur de thème: il m’affiche : “Désolé, ce fichier ne peut pas être modifié” . Ceci est problématique car j’utilise l’éditeur pour créer et modifier des fichier de mon thème créé grace à votre plugin. Ce problème provient bien de la mise a jour de WP car lorsque je downgrade vers la version 6.5, j’ai de nouveau accès à l’éditeur de fichiers du thème. Ne serait -il pas judicieux d’envisager une Mise à jour du plugin pour de nouveau accéder à cette fonctionnalité d’édition? ou est-ce que l’éditeur de fichiers du thème est condamné par WP? Merci pour vos pistes de réflexion !:)
]]>I exported a theme which contains templates that can be assigned to posts and pages.
I imported the theme to another site, and I could see all the templates I had created. However when i go to posts or pages, i cannot change the template to the custom ones.
The workaround is to go to each custom template and resave each one at a time. Then it works.
Is there a way to fix this?
Thanks
Sandra
]]>Hello!
I just noticed an error in the Read me file as I was translating chains oh the plugin
Is it possible to correct this word in the Read Me file: “theme:ons“
from the following sentence:
“To create a new Clone of the current theme or to create a Child of the current theme:ons for the currently active theme:”
Thanks in advance
When pressing the “Create Block Theme”-link in the dashboard (Appearance) I get the error that I don’t have access to the page.
I do have admin rights. I’ve tried deactivate/activate the plugin. Tried switching themes. Tried a user plugin to add “resume theme”-rights to my user. Still error.
Any ideas what to do?
]]>Hi:
If I work on a site, making changes to a block theme only via the Site Editor & templates – those changes remain when the theme is updated, correct? I shouldn’t have to create a child theme, correct?
I have several clients I’m transitioning from Classic to Block themes. I’m working on more than one site in my MAMP install (to speed up the switchovers when the new site goes live) all based on the same theme, but looking very different. I’ve been creating child themes, but I could just use clones, couldn’t I?
Clones are “copies” of the base theme with changes, right? So when the theme comes out with updates, they’d apply, right?
Thanks!
I am building a new website using the Twenty Twentyfour theme. I added Roboto and Robot Slab to replace the default fonts (Inter/Jost). I also added a few custom colors.
In the block editor when I click the wrench icon to open the Create Block Theme menu and then click “Save Changes to Theme” > Save Changes, I get an error.
Request Data
URL: /wp-json/create-block-theme/v1/save?_locale=user
Method: POST
Data:
- localizeImages: false
- localizeText: false
- processOnlySavedTemplates: true
- removeNavRefs: false
- saveFonts: true
- saveStyle: true
- saveTemplates: true
Response Data
- “code”: “internal_server_error”,
- “message”: “There has been a critical error on this website. Learn more about troubleshooting WordPress.“,
- “data”: {
- “status”: 500,
- “error”: {
- “type”: 1,
- “message”: “Uncaught TypeError: basename(): Argument #1 ($path) must be of type string, array given in \wp-content\plugins\create-block-theme\admin\create-theme\theme-fonts.php:117
Stack trace:
#0 \wp-content\plugins\create-block-theme\admin\create-theme\theme-fonts.php(117): basename(Array)
#1 \wp-content\plugins\create-block-theme\admin\create-theme\theme-fonts.php(11): Theme_Fonts::remove_deactivated_fonts_from_theme()
#2 \wp-content\plugins\create-block-theme\includes\class-create-block-theme-api.php(444): Theme_Fonts::persist_font_settings()
#3 \wp-includes\rest-api\class-wp-rest-server.php(1230): Create_Block_Theme_API->rest_save_theme(Object(WP_REST_Request))
#4 \wp-includes\rest-api\class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request(Object(WP_REST_Request), ‘/create-block-t…’, Array, NULL)
#5 \wp-includes\rest-api\class-wp-rest-server.php(439): WP_REST_Server->dispatch(Object(WP_REST_Request))
#6 \wp-includes\rest-api.php(428): WP_REST_Server->serve_request(‘/create-block-t…’)
#7 \wp-includes\class-wp-hook.php(324): rest_api_loaded(Object(WP))
#8 \wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(”, Array)
#9 \wp-includes\plugin.php(565): WP_Hook->do_action(Array)
#10 \wp-includes\class-wp.php(418): do_action_ref_array(‘parse_request’, Array)
#11 \wp-includes\class-wp.php(813): WP->parse_request(”)
#12 \wp-includes\functions.php(1336): WP->main(”)
#13 \wp-blog-header.php(16): wp()
#14 \index.php(17): require(‘C:\\laragon\\www\\…’)
#15 {main}
thrown”,- “file”: “\wp-content\plugins\create-block-theme\admin\create-theme\theme-fonts.php”,
- “line”: 117
- }
- },
- “additional_errors”: []
I’m not sure if this is something I can fix, so I thought I would report it here.
The fonts I have loaded are:
Other plugins loaded:
Hey!
Today I tried to export a custom child theme including the fonts from the site editor and run into the following warnings and errors:
[12-May-2024 14:21:46 UTC] PHP Warning: Undefined array key "typography" in /wp-content/plugins/create-block-theme/admin/create-theme/theme-fonts.php on line 111
[12-May-2024 14:21:46 UTC] PHP Warning: Trying to access array offset on null in /wp-content/plugins/create-block-theme/admin/create-theme/theme-fonts.php on line 111
[12-May-2024 14:21:46 UTC] PHP Fatal error: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in /wp-content/plugins/create-block-theme/admin/create-theme/theme-fonts.php:110
Stack trace:
#0 /wp-content/plugins/create-block-theme/admin/create-theme/theme-fonts.php(110): array_filter(NULL, Object(Closure))
#1 /wp-content/plugins/create-block-theme/admin/create-theme/theme-fonts.php(11): Theme_Fonts::remove_deactivated_fonts_from_theme()
#2 /wp-content/plugins/create-block-theme/includes/class-create-block-theme-api.php(444): Theme_Fonts::persist_font_settings()
#3 /wp-includes/rest-api/class-wp-rest-server.php(1230): Create_Block_Theme_API->rest_save_theme(Object(WP_REST_Request))
#4 /wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/create-block-t...', Array, NULL)
#5 /wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch(Object(WP_REST_Request))
#6 /wp-includes/rest-api.php(428): WP_REST_Server->serve_request('/create-block-t...')
#7 /wp-includes/class-wp-hook.php(324): rest_api_loaded(Object(WP))
#8 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#9 /wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#10 /wp-includes/class-wp.php(418): do_action_ref_array('parse_request', Array)
#11 /wp-includes/class-wp.php(813): WP->parse_request('')
#12 /wp-includes/functions.php(1336): WP->main('')
#13 /wp-blog-header.php(16): wp()
#14 /index.php(17): require('/Users/mrx')
#15 {main}
thrown in /wp-content/plugins/create-block-theme/admin/create-theme/theme-fonts.php on line 110
The custom theme.json doesn’t have a typography field inside the settings array.
As soon as I add the following array to the theme.json file the export works fine:
"typography": {
"fontFamilies": []
}
Greetings
derRALF
I am happily using a block theme that I designed with this plugin. No errors in the theme when using it. I want to use it on another site and therefore I “Export to Zip” and uploaded it to a fresh install of worpdress 6.5.2 (same version of wordpress I exported the theme from). After installation of the theme and activation, I get the below error:
Parse error: syntax error, unexpected identifier “freshsnow”, expecting “)” in /home/sknowed-development/htdocs/development.sknowed.com/public/wp-content/themes/fsefreshsnow/patterns/footer.php on line 17
Line 17 is per below.
<h2 class="wp-block-heading has-white-color has-text-color has-link-color"><?php echo __('Contact', 'fse <?php echo __('freshsnow', 'fsefreshsnow');?>');?></h2>
I can see already there is another line like above that will produce an error like above. Is this some sort of bug? I re-exported a couple of times and still have the same problem. Any tips appreciated.
]]>When I try to export my theme with “export theme”, I get this in debug.log :
[24-Apr-2024 07:34:43 UTC] PHP Warning: foreach() argument must be of type array|object, null given in /home/MYFOLDER/wp-content/plugins/create-block-theme/admin/create-theme/theme-zip.php on line 40
[24-Apr-2024 07:34:43 UTC] PHP Fatal error: Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given in /home/MYFOLDER/wp-content/plugins/create-block-theme/admin/create-theme/theme-zip.php:74
Stack trace:
#0 /home/MYFOLDER/wp-content/plugins/create-block-theme/admin/create-theme/theme-zip.php(74): array_merge()
#1 /home/MYFOLDER/wp-content/plugins/create-block-theme/includes/class-create-block-theme-api.php(386): Theme_Zip::add_activated_fonts_to_zip()
#2 /home/MYFOLDER/wp-includes/rest-api/class-wp-rest-server.php(1230): Create_Block_Theme_API->rest_export_theme()
#3 /home/MYFOLDER/wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request()
#4 /home/MYFOLDER/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch()
#5 /home/MYFOLDER/wp-includes/rest-api.php(428): WP_REST_Server->serve_request()
#6 /home/MYFOLDER/wp-includes/class-wp-hook.php(324): rest_api_loaded()
#7 /home/MYFOLDER/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#8 /home/MYFOLDER/wp-includes/plugin.php(565): WP_Hook->do_action()
#9 /home/MYFOLDER/wp-includes/class-wp.php(418): do_action_ref_array()
#10 /home/MYFOLDER/wp-includes/class-wp.php(813): WP->parse_request()
#11 /home/MYFOLDER/wp-includes/functions.php(1336): WP->main()
#12 /home/MYFOLDER/wp-blog-header.php(16): wp()
#13 /home/MYFOLDER/index.php(17): require('/home/noru8363/...')
#14 {main}
thrown in /home/MYFOLDER/wp-content/plugins/create-block-theme/admin/create-theme/theme-zip.php on line 74
]]>
To reproduce
Result
New clean theme with TT4 theme,
Import some content
Install Create Block theme Plugin v. 2.0.2, activate it
Create Block Theme child
Try to upoad it. Get error msg. “
Installing theme from uploaded file: tt4childdev08.zip
Unpacking the package…
Installing the theme…
Destination folder already exists. /www/wp-content/themes/twentytwentyfour/This theme is already installed.ActiveUploadedTheme nameTwenty Twenty-Fourtt4childdev08Version1.11.0.0Authorthe WordPress team-Required WordPress version6.46.0Required PHP version7.05.7Parent theme-twentytwentyfour
You are uploading an older version of the active theme. You can continue to install the older version, but be sure to back up your database and files first.
Messages in Dashboard: The active theme is broken. Reverting to the default theme.Dismiss this notice.
Error: The theme defines itself as its parent theme. Please check the?Template
?header.
White screen result
]]>After creating a child theme, I created a new screenshot (screenshot.png), but the new one doesn’t display. It still shows the ‘Create Theme Block’ image. The only way to change it is to save it as a jpg
and delete the .png
version.
Hi there,
Currently I’m trying to save my user changes to my theme folder using the overwrite theme option within the menu of create block theme.
Whenever I do this, I’m getting a fatal error in WordPress.
And then my debug log tells me:
[19-Apr-2024 13:04:54 UTC] PHP Fatal error: Cannot redeclare turn_off_reject_unsafe_urls() (previously declared in /var/www/my-website/wp-content/plugins/create-block-theme/admin/create-theme/theme-media.php:101) in /var/www/my-website/wp-content/plugins/create-block-theme/admin/create-theme/theme-media.php on line 101
I’ve also tried doing it from within the new full site editor menu. But this simply returns a 500 internal server error. With I think the same error message.
This started happening after the latest update to the create block themes plugin.
If it has to do with https and certificates, that could be the case because I have a self signed certificate on my local development machine. But this hasn’t changed since the update.
I would like to save my user made changes in my full site editor to my block theme. I’m also not in the mood of manually copy/pasting all the code of all the changes I’ve made.
I’ll try to revert back to the previous version to see if the problem persists for now.
Please let me know if there is anything I can do to help diagnose the issue, or perhaps help figure out if this is something that happens to others.
If you want me to make a clean WordPress install and replicate the issue, I’ll try that later.
Hello,
For my project, I don’t need to translate my website. Is there an option to avoid compiling most of my templates with translatable strings (like code bellow) ? Several patterns are therefore created unnecessarily.
<!-- wp:paragraph -->
<p><?php echo __('Modifié le: ', 'gncom-v8');?></p>
<!-- /wp:paragraph -->
<!-- wp:post-date {"displayType":"modified"} /-->
Thank you.
Grégoire
WordPress v 6.5.2
Create Block Theme v 2.0.2
Twenty Twenty-four theme
I have a 2 language multi-site (sub-folder) website
Using 2 Child themes of Twenty Twenty-four (one for each language version).
The Create Block Theme plugin is "Network enabled".
Problem:
When trying to load site-editor.php (Appearance > Editor) a blank black screen displays and the WordPress UI is gone.
The (browser) page had finished loading and the Firefox browser headers are all displaying properly. I can return to the WordPress UI by pressing the back arrow.
The live website styles are all messed up, the nav bar text is black instead of white, font sizes and line spacing are wrong.
Solution (temporary) :
I disabled the the Create Block Theme plugin > "Network disabled" and the problem is resolved.
I still need to be able to create block themes so simply disabling the plugin is not a longterm option.
Is this issue being reported elsewhere?
]]>
Hi. I’ve created a blank block theme. If I enter something in the style.css (for example body{background-color:black !important;}
, the styling doesn’t work and I can’t find the style.css in the source code either. Do I have to do anything else so that the style.css is used by the theme?
The option to save changes to a Style Variation from the site editor no longer allows you to give the variant a name. The previous option list from the Appearance dashboard did give that option.
Please don’t forget to add that back in before the dashboard options settings are deprecated!
]]>