$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>css - Font size decreases when child theme is created from parent theme?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

css - Font size decreases when child theme is created from parent theme?

matteradmin7PV0评论

While creating and activating the child theme, the font size decreases as compared to parent theme

<?php function my_theme_enqueue_styles() {

$parent_style = 'spicepress-style'; // This is 'spicepress-style' for the Spicepress theme.

wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
    get_stylesheet_directory_uri() . '/style.css',
    array( $parent_style ),
    wp_get_theme()->get('Version')
);}add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles',10 );?>

While creating and activating the child theme, the font size decreases as compared to parent theme

<?php function my_theme_enqueue_styles() {

$parent_style = 'spicepress-style'; // This is 'spicepress-style' for the Spicepress theme.

wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
    get_stylesheet_directory_uri() . '/style.css',
    array( $parent_style ),
    wp_get_theme()->get('Version')
);}add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles',10 );?>
Share Improve this question asked Nov 13, 2018 at 6:24 Madhur JainMadhur Jain 1 2
  • Inspect the element's CSS with the browser's developer tools which each theme active. Do you notice any different rules being applied? – Jacob Peattie Commented Nov 13, 2018 at 7:47
  • 1 Hi Jacob, I searched and found that parent style has dependency on bootstrap.css. I added the dependency in functions.php and it worked out fine. Thanks for your effort and time !! – Madhur Jain Commented Nov 13, 2018 at 8:49
Add a comment  | 

1 Answer 1

Reset to default 0

Parent style had dependency on bootstrap.css. I added the dependency in the functions.php and it worked out fine.

Found this link helpful for my problem https://wordpress.stackexchange/a/252360/153981

Post a comment

comment list (0)

  1. No comments so far