• I’m in the process of editing my first child theme and I’m a bit stuck when trying to change the overall font on my website.

    I’ve inserted the following into my function.php

    function load_fonts() {
                wp_register_style('et-googleFonts', 'https://fonts.googleapis.com/css?family=Open+Sans');
                wp_enqueue_style( 'et-googleFonts');
            }
        add_action('wp_print_styles', 'load_fonts');

    What do I need to add to my style.css to change the font throughout the entire website including Menus? The only different will be sizing and colours (for links).

    Thank you.

    Ella

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please provide a link to a page on your site where we can see this. Thanks.

    Thread Starter ellacopter

    (@ellacopter)

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Your site is currently broken. Check the child functions.php

    
    Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d262023013/htdocs/audiopluscouk/wordpress/wp-content/themes/twentyeleven-child/functions.php:8) in /homepages/34/d262023013/htdocs/audiopluscouk/wordpress/wp-includes/pluggable.php on line 1210

    *Quicksand to your font name.

    body {
    font-family: 'Quicksand', sans-serif;
    }

    Index.php and other important .php files.
    <link href="https://fonts.googleapis.com/css?family=Quicksand" rel="stylesheet">

    Thread Starter ellacopter

    (@ellacopter)

    Thank you, both.

    My functions.php is as follows

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
    function my_theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );

    }
    ?>

    Any clue whats wrong wih it? I copied it from https://codex.www.ads-software.com/Child_Themes

    Thread Starter ellacopter

    (@ellacopter)

    The full error message I’m getting is

    Warning: Cannot modify header information – headers already sent by (output started at /homepages/34/d262023013/htdocs/audiopluscouk/wordpress/wp-content/themes/twentyeleven-child/functions.php:8) in /homepages/34/d262023013/htdocs/audiopluscouk/wordpress/wp-includes/pluggable.php on line 1210

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Remove the last line, ?>.

    Thread Starter ellacopter

    (@ellacopter)

    You bloody genius Steve, thank you!

    Thread Starter ellacopter

    (@ellacopter)

    So to change the font, do I need to change anything other than the functions.php and style.css?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You just need to add a font-family line to your CSS.

    Thread Starter ellacopter

    (@ellacopter)

    Thank you. I think the problem is solved now.

    Thanks for being so patient with me!!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Font Change’ is closed to new replies.