How to create a Child Theme for Stax?

Home Forums Technical Theme Support STAX Theme How to create a Child Theme for Stax?

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #455774
    Tim Bernhard
    Participant

    I would like to adjust some details in Stax for my purposes.
    As is customs, I would like to do that with a child theme.
    Using the regular code:

    organic-staxchild/style.css:

    /*
    Theme Name:   Stax Child
    Description:  Stax' Child Theme
    Author:       Tim Bernhard
    Author URI:   https://genieblog.ch
    Template:     organic-stax
    Version:      1.0.0
    Text Domain:  organic-staxchild
    */

    and organic-staxchild/functions.php:

    
    <?php
    
    function my_theme_enqueue_styles()
    {
      wp_enqueue_style(
        'organic-staxchild-style',
        get_stylesheet_uri(),
        array('organic-stax'),
        wp_get_theme()->get('Version')
      );
    }
    
    add_action('wp_enqueue_scripts', 'my_theme_enqueue_styles');
    

    this results in all the header, footer etc. not being displayed, despite them being shown when using the full-site editor.

    What’s the correct way to make a child-theme here?

    #455857
    David Morgan
    Keymaster

    Hi Tim,

    Your code looks correct for a traditional child theme. However, since STAX is a block theme, the process is slightly different. I believe there is an additional requirement for a theme.json file. The following links may help:

    You can use this plugin to create a child theme for block themes:

    Create Block Theme

    This is an official tutorial from WordPress on the process:

    Create a Basic Child Theme for Block Themes

    I hope this helps.

    Thanks!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.