Wordpress child theme style.css not working

前端 未结 5 1899
[愿得一人]
[愿得一人] 2021-02-01 21:34

I have created a file structure in the same format as my parent theme. My parent theme is called Alpine and within Alpine there is a functions.php and style.css file. There do n

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-01 21:52

    Take a look at your tag. More importantly look at the order of your stylesheets.

    The styles from your child theme are being added first and then all the styles from your parent theme. This will cause the styles from the parent theme to override your child theme styles.

    You can change the priority of your my_theme_enqueue_styles function to run after the parent by using the third parameter of add_action. This will enqueue your child theme styles last and allow the CSS to work as expected.

    
    

提交回复
热议问题