Hello @lclc
I hope you have Enqueue the Child Theme Styles properly in the child themes function.php file.
Sometimes, the order in which stylesheets are loaded affects how styles are applied. Ensure that the child theme’s styles are loaded after the parent theme’s styles.
You can adjust the priority of the my_theme_enqueue_styles function to ensure the child theme styles load last:
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles', 11 );
The priority value ensures that the child theme styles load after the parent theme styles.
That’s all came up in my mind now.
Thread Starter
lclc
(@lclc)
Thanks Roy. This is my child’s functions file:
<?php
/**
* Twenty Twenty-Four functions and definitions
*
* @link https://developer.ww.wp.xz.cn/themes/basics/theme-functions/
*
* @package Twenty Twenty-Four
* @since Twenty Twenty-Four 1.0
*/
/**
* Register block styles.
*/
add_action( 'wp_enqueue_scripts', 'grand_sunrise_enqueue_styles' );
function grand_sunrise_enqueue_styles() {
wp_enqueue_style(
'grand-sunrise-parent-style',
get_parent_theme_file_uri( 'style.css' )
);
}
?>
-
This reply was modified 2 years ago by
lclc.
You can try this –
<?php
/**
* Twenty Twenty-Four functions and definitions
*
* @link https://developer.ww.wp.xz.cn/themes/basics/theme-functions/
*
* @package Twenty Twenty-Four
* @since Twenty Twenty-Four 1.0
*/
/**
* Register block styles.
*/
add_action( 'wp_enqueue_scripts', 'grand_sunrise_enqueue_styles', 20 );
function grand_sunrise_enqueue_styles() {
wp_enqueue_style(
'grand-sunrise-parent-style',
get_parent_theme_file_uri( 'style.css' )
);
// If not work then Test by Enqueuing your child theme's stylesheet here
}
?>
Thread Starter
lclc
(@lclc)
Thanks, Roy, but no change.
Thread Starter
lclc
(@lclc)
Here is my stylesheet:
/**
* Theme Name: Grand Sunrise
* Template: twentytwentyfour
* Theme URI: https://ww.wp.xz.cn/themes/twentytwentyfour/
* Author: the WordPress team
* Author URI: https://ww.wp.xz.cn
* Description: Twenty Twenty-Four is designed to be flexible, versatile and applicable to any website. Its collection of templates and patterns tailor to different needs, such as presenting a business, blogging and writing or showcasing work. A multitude of possibilities open up with just a few adjustments to color and typography. Twenty Twenty-Four comes with style variations and full page designs to help speed up the site building process, is fully compatible with the site editor, and takes advantage of new design tools introduced in WordPress 6.4.
* Requires at least: 6.4
* Tested up to: 6.5
* Requires PHP: 7.0
* Version: 1.1
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: twentytwentyfour
* Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, style-variations, accessibility-ready, blog, portfolio, news
*/