My wordpress child theme uses the parent's theme font-family, no matter what font i choose in my child theme css

S

Stefan L.

Guest
I tried to apply a different font-family in my child theme but the theme uses the parent theme's font. Other css properties work fine. I have this problem only with the font-family property. It works only when i use !important. Any help is much appreciated.

The child theme's function.php file:

<?php

add_action( 'wp_enqueue_scripts', 'load_theme_assets' );

function load_theme_assets() {

$parent_style = 'parent-style';

wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );

# Loading Child Theme Main Stylesheet
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css');

# Loading AOS Stylesheet
wp_enqueue_style( 'aos', get_stylesheet_directory_uri() . '/assets/css/aos.css');

# Loading Owl Carousel Stylesheet
wp_enqueue_style( 'owl-carousel', get_stylesheet_directory_uri() . '/assets/css/owl.carousel.css');

# Loading Owl Carousel Theme Default Stylesheet
wp_enqueue_style( 'owl-theme-default', get_stylesheet_directory_uri() . '/assets/css/owl.theme.default.css');

# Loading Google Fonts
wp_enqueue_style( 'custom-google-fonts', 'https://fonts.googleapis.com/css?family=Lora|Martel|Noto+Serif+SC|Playfair+Display&display=swap', false);

# Loading Font Awesome Icons
wp_enqueue_style( 'all', get_stylesheet_directory_uri() . '/assets/css/all.css');


And my CSS file:

body {
border: 1px solid #999;
background-color: #F9F8F8;
font-family: 'Martel', serif;
}


So, i can see the border and the background change, but the font remains the same.

Continue reading...
 
Top