Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Kathryn Presner

    (@zoonini)

    Hi there @schwimmlehrer could you please confirm whether or not you used the Create Block Theme plugin‘s child theme option to create your child theme?

    If not, would you mind doing a test by creating a child theme using the plugin, and let me know if you get the same error on multisite?

    Could you also please clarify whether you only still the issues you mentioned when all plugins are temporarily disabled? Or are the issues only present when WooCommerce is active?

    Thanks.

    Thread Starter schwimmlehrer

    (@schwimmlehrer)

    Hello I tried with Create Block Themes but this plugin has many bugs, for example I had to comment out the line that adds the screenshot. This plugin is really bad. I tried with a fresh install of WordPress and just WooCommerce, Multisite and a very basic child theme. And I am not the only one with the problem. I don’t know if I already mentioned here I now copied the Twenty Twenty Three theme and this is how it works for me, i.e. modifying the theme directly without creating a child theme. I spent many full days of testing to find the problem and this solution forme.

    Moderator Kathryn Presner

    (@zoonini)

    Ah darn… I’m glad you found a workaround for now, but I have asked the Create Block Theme devs to take a look at the multisite/child theme issue. I’ve also pointed them to the thread over in Fixing WP as well as yours here.

    I’m crossing my fingers that they can find the source of the issue and make the necessary fixes.

    Thanks for reporting the issue. I’ll keep you posted here if I have any news.

    Hi @schwimmlehrer – can you give me some extra context how you are using the plugin please. Have you activated it for 1 specific subsite, or did you network activate it for all subsites?

    Also, what kind of multisite setup are you running – subsites, sub folders, are you domain mapping at all?

    Let me know as there are multiple configurations for multisite that could be the root cause.

    I tested today with WP 6.1.1 using subsites, Twenty Twenty Two and Three, successfully created child themes with WooCommerce active and inactive. So I’d love to understand the context you are using it in so I can test further.

    Thread Starter schwimmlehrer

    (@schwimmlehrer)

    Hello thanks for testing. plugins are activate for whole network. I use folders as subsites. I created a test site just with the components I described and I get the error. Same error on local testsite and also on my production site. I just tested again with everything updated, same problem. I will post my child theme next.

    Did you check this page specifically I attach to this post? (also the site editor is broken): https://imgur.com/a/Pl9p0D1

    Thread Starter schwimmlehrer

    (@schwimmlehrer)

    Child theme functions.php

    <?php
    /* Inline script printed out in the header */
    function my_styles() {
    	$parent_style = 'twentytwentythree-style'; 
    	$child_style = 'twentytwentytree-child-style';
    	wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    	wp_enqueue_style('main-styles', get_template_directory_uri() . '/style.css', array(), filemtime(get_template_directory() . '/style.css'), false);	
    	wp_enqueue_style( $child_style, get_stylesheet_uri(), array(), filemtime(get_stylesheet_directory() . '/style.css') );
    }
    add_action("wp_enqueue_scripts", "my_styles");
    ?>

    style.css

    /*
    Theme Name: Twenty Twenty Three Child
    Template: twentytwentythree
    */
    ...

    then there is theme.json

    I checked a thousand times if I have a typo in my style.css header comments… but since the twenty twenty two child is similar and works I dare to say it *could* be not my mistake…

    I was able to test and reproduce the issue with Twenty Twenty-Three

    In WP core (class WP_Theme) the function responsible for finding the parent theme path search_theme_directories returns false because global $wp_theme_directories is not set in the following conditions.

    * Active child/parent theme is a block theme.
    * And WooCommerce is network enabled.

    The issue doesn’t happen if the Woo Plugin is activated at site level.

    I will investigate further post more updates.

    The issue seems to be happening with themes such as Twenty Twenty-Three, Bibimbap etc. but not with Pixl because it is shopped with an empty index.php.

    Since it is optional to include index.php, the condition in WP core (class WP_Theme) might need to check for style.css instead.

    It is best to create an issue with WP core and investigate further for the better solutions and other scenarios.

    @schwimmlehrer as a workaround can you add an empty index.php in your child theme?

    One of my plugins contained the following function:
    wp_is_block_theme()
    I don’t know why, but when i removed this code, the child theme and editor worked fine.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Child theme in multisite shows error’ is closed to new replies.