How To Load wp_add_inline_styles

You need to add enqueue your child themes style sheet as well add_action( ‘wp_enqueue_scripts’, ‘inline_bar_width’ ); function inline_bar_width() { wp_enqueue_style( ‘twentytwenty-style’, get_stylesheet_directory_uri() . ‘/style.css’ ); if ( is_category( ‘ratings’ ) ) { $bar = bar_width(); $css=””; $css .= sprintf(‘.bar {width: %s%%;}’, $bar ); if ( $css ) { wp_add_inline_style( ‘twentytwenty-style’, $css ); } } }