• Resolved krzakx

    (@krzakx)


    Hello Gutenverse users and teams!
    1st of all thank you for great added value to WP ecosystem.

    I do face issues with overwriting my headings styling by frontend.css (/wp-content/plugins/gutenverse/lib/framework/assets/css/frontend.css) -> very similar to that topic https://ww.wp.xz.cn/support/topic/a-gutenverse-update-changed-css-on-my-site-made-headers-tiny/

    My biggest concern is:

    • why config from theme.json doesn’t work ? – please notice that I do use child-theme approach and my function.php is following:
    <?php

    // Dodaj wsparcie dla theme.json i globalnych stylów
    function vorfolio_child_theme_setup() {
    // Wsparcie dla globalnych stylów i theme.json
    add_theme_support('wp-block-styles');
    add_theme_support('editor-styles');
    add_theme_support('block-editor-settings');
    add_theme_support('block-templates');

    // Wsparcie dla custom-spacing
    add_theme_support('custom-spacing');

    // Wsparcie dla custom-units
    add_theme_support('custom-units');

    // Wsparcie dla custom-line-height
    add_theme_support('custom-line-height');
    }
    add_action('after_setup_theme', 'vorfolio_child_theme_setup');

    // Zmodyfikowana funkcja ładowania stylów
    function vorfolio_child_enqueue_styles() {
    // Załaduj style motywu nadrzędnego
    wp_enqueue_style(
    'parent-style',
    get_template_directory_uri() . '/style.css',
    array(),
    wp_get_theme()->parent()->get('Version')
    );

    // Załaduj frontend.css motywu nadrzędnego
    wp_enqueue_style(
    'parent-frontend-style',
    get_template_directory_uri() . '/assets/css/frontend.css',
    array('parent-style'),
    wp_get_theme()->parent()->get('Version')
    );

    // Załaduj style motywu potomnego
    wp_enqueue_style(
    'child-style',
    get_stylesheet_uri(),
    array('parent-frontend-style'),
    wp_get_theme()->get('Version')
    );
    }
    add_action('wp_enqueue_scripts', 'vorfolio_child_enqueue_styles');

    // Dodaj wsparcie dla edytora bloków
    function vorfolio_child_block_editor_settings() {
    add_theme_support('editor-styles');
    add_editor_style('style.css');
    }
    add_action('after_setup_theme', 'vorfolio_child_block_editor_settings');

    My temporary solution is that I’ve simple removed heding styling from frontend.css however what I am looking for is full styling genereted from theme.json.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support putra1arya

    (@putra1arya)

    How did you create your child theme?
    I tried replicate your issue but it generate the theme.json style.

    I create the child theme using Create Block Theme Plugin. Then adding your functions.php to it.
    And you don’t need to enqueue the frontend.css ( ‘parent-frontend-style’ ) because there is no frontend.css in the vortofolio theme.

    Thread Starter krzakx

    (@krzakx)

    Oh… I did created it manually – maybe I did it poorly.

    because there is no frontend.css in the vortofolio theme.

    But it does come from Gutenverse plugin, see:

    plugins/gutenverse/lib/framework/assets/css/frontend.css

    Anyway looks like I should recreate my Child Theme using and plugin.

    Plugin Support putra1arya

    (@putra1arya)

    If you’re trying to include frontend.css from Gutenverse and using get_template_directory(), you might be using the wrong path. This function returns the directory of the currently active theme, not the plugin.

    To correctly include frontend.css from Gutenverse, use:

    plugins_url('gutenverse/lib/framework/assets/css/frontend.css')

    However, since this stylesheet is already enqueued by the plugin, you don’t need to enqueue it manually—it loads automatically.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘theme.json and frontend.css’ is closed to new replies.