Home › Forums › Technical Theme Support › STAX Theme › problem with stax’s child theme
- This topic has 9 replies, 3 voices, and was last updated 2 days, 7 hours ago by Charles.
-
AuthorPosts
-
December 16, 2024 at 8:34 am #468597alexis beaumontParticipant
Hello,
i’ve created stax child theme from theme demoorganic-staxchild/style.css:
/*
Theme Name: musicstore63
Theme URI:
Author: Stephane Jallade
Author URI:
Description:
Requires at least: 6.7
Tested up to: 6.7
Requires PHP: 5.7
Version:
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: Template: organic-stax
Text Domain: musicstore63
Tags:
*/i’ve created also functions.php :
<?php
// fonctions du thème
// CSS pour le back-office et autre
function gn_empty_setup() {// Rendre le thème traduisible
load_theme_textdomain( ‘fse-base-gn-empty’, get_template_directory() . ‘/languages’ );// Ajouter le CSS du front pour le back
add_editor_style(
array(
‘./style.css’,
)
);// Supprimer les compositions par défaut
remove_theme_support( ‘core-block-patterns’ );}
add_action( ‘after_setup_theme’, ‘gn_empty_setup’ );// Enqueue le CSS pour le front-office
add_action( ‘wp_enqueue_scripts’, ‘gn_empty_enqueue_style_sheet’ );
function gn_empty_enqueue_style_sheet() {wp_enqueue_style( ‘organic-stax’, get_template_directory_uri() . ‘/style.css’, array(), wp_get_theme()->get( ‘Version’ ) );
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
wp_enqueue_style( ‘child-style’,
get_stylesheet_directory_uri() . ‘/style.css’,
array(‘parent-style’)
);
}But i have problem : all the header, footer etc. not being displayed, despite them being shown when using the full-site editor.
I’ve already created child themes on full site editing templates, but now with stax child theme I can’t display the menus and footer.
thanks for your help
best regardsDecember 30, 2024 at 6:38 am #468826alexis beaumontParticipanthello,
is there anyone who could help me ?
best regardsJanuary 3, 2025 at 9:22 am #468897David MorganKeymasterHi Alexis,
Thanks for reaching out and using STAX!
How are you creating a child theme? Some customers have had luck using the following plugin for child theme creation: https://wordpress.org/plugins/child-theme-configurator/
Additionally, why are you creating a child theme? I ask, because child themes are typically unnecessary for newer block theme like STAX. Using a block theme, template customizations can always be reverted, and won’t be overwritten with theme updates. Additionally, any extra functionality can typically be added using a plugin like Code Snippets rather than using an entirely separate child theme.
Thanks!
January 7, 2025 at 7:23 am #468956alexis beaumontParticipantThis reply has been marked as private.January 10, 2025 at 5:19 am #469006David MorganKeymasterHi Alexis,
I apologize for the delay. I’m looking into the header and footer display for child themes.
However, it should be noted that your reason for creating a child theme does warrant the creation of a child theme. Custom CSS can be added using the Additional CSS section of the Customizer or Editor. Or, you can use a plugin like Code Snippets to add custom CSS, https://wordpress.org/plugins/insert-headers-and-footers/
Using any of those options will allow for your custom code to reamin unaffected by theme updates without the overhead and issues that child themes cause. Most information regarding the creation of child themes is outdated and unnecessary as it relates to newer themes.
I hope this helps.
Thanks!
January 11, 2025 at 10:34 pm #469017alexis beaumontParticipanthello
thanks a lot for your answer. The stax version 1.6 solves the child theme problem. Great !
yes, I can add custom styles.
If there were only styles to add, I wouldn’t create a child theme.
But I also want to change the default color palette and have specific fluid sizes.
and I don’t think I can do it any other way than in a theme.json file different from the one proposed in the parent theme.
That’s why I want a child theme
is it possible to customize the theme.json file without creating a child theme?
thanksBest regards
AlexisJanuary 15, 2025 at 4:47 am #469073David MorganKeymasterHi Alexis,
Glad to hear it’s working properly for you now!
You should not need to edit the theme.json file directly in order to make your desired changes. All the values for the theme.json file can be modified in the Site Editor without modifying any code directly. This can be done in the global styles section of the Editor. Color palettes, fonts, sizes, spacing, layout widths, and style options for all blocks can be changed in the Editor, illustrated in the attached screenshots.
I hope this helps. Thanks!
Attachments:
You must be logged in to view attached files.January 19, 2025 at 1:29 am #469138alexis beaumontParticipantHi David,
I’m sorry but I still have a little problem with the stax child theme: some template parts don’t display natively on the page templates concerned:
– banner image
– shop filter
– footer link
I have to add them manually
is it possible to correct this?
Thanks a lot
Best regardsJanuary 19, 2025 at 8:32 pm #469148CharlesParticipantHi Alexis, can you please send the link to your website? Thank you
January 19, 2025 at 9:03 pm #469150CharlesParticipantHi Alexis, disregard that message we got your website 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.