How to change <p> in css with a custom theme?

In a WP site developed with a custom theme, I saw that font size of the paragraph tag seems to be defined in

/wp-content/themes/nameofcustomtheme/style.css?ver=1.1.11

I have tried to change font-size to 18px in style.css located there, but now the inspector says that

is defined by a css file located at

/?sccss=1ver=4.6

And that the font size remains 16px.

How could I change the paragraph tag font size?

Topic css Wordpress

Category Web


Since you are working on a child theme you could try the following. This requires that you have removed @import from your child themes style.css or removed the hook, that loads the parent stylesheet in your child themes functions.php.

Add this to your functions.php in the child theme:

function wp_enq_theme_styles() {

    $parent_style = 'parent-style';
    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 ) );
}
add_action( 'wp_enqueue_scripts', 'wp_enq_theme_styles' );

What this code does is enqueuing the parent style first and then the child style. The array part of the child-style tells wordpress that the child style is dependent on the parent style thus it is loaded after the parent style. Hence your child styles will override the parent styles.

Hope this helps.

PS. you can always read more about it here

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.