• Thank you all for reading my mail.
    I was tasked with the task of using the new approved Google fonts for our company. I tried going through the route of using a Build Press Child theme and it didn’t work. I added the below codes to function.php as recommended information states:

    function child_scripts()
    {
    wp_enqueue_style(‘child-google-fonts’,’//fonts.googleapis.com/css? family=El+Messiri:700|Trirong:400i,500i,700″ rel=”stylesheet’);
    }

    add_action (‘wp_enqueue_scripts’, ‘child_scripts’);

    This code was added just immediately after the enqueuing stylesheet code for the parent code. Immediately I updated it didn’t work and my website wasn’t displaying anymore. I went to the Cpanel root directory to remove the code.

    I tried the second method of using a plugin called Easy Google font. Immediately I installed it, I received an error

    Warning: Cannot modify header information – headers already sent by (output started at /home/heightsaccess/public_html/wp-content/themes/buildpress-child/functions.php:21) in /home/heightsaccess/public_html/wp-includes/pluggable.php on line 1224

    Now I no longer have access the WORDPRESS dashboard so can even unintall the plugging.
    Kindly reply me .

    Thank you .

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

    (@sterndata)

    Volunteer Forum Moderator

    here’s the code I use to add google fonts:

    function mytheme_google_fonts() {
            wp_enqueue_style( 'mytheme_google_fonts', 'https://fonts.googleapis.com/css?family=El+Messiri:700|Trirong:400i,500i,700' );
    }
    add_action( 'wp_enqueue_scripts', 'mytheme_google_fonts' );
    

    To address your problem, use FTP or the hosting control panel to delete the plugin you just installed in wp-content/plugins

    Thread Starter Michael Liberty

    (@michael-liberty)

    Thank you Steve,
    I just deleted the Easy google font and still can’t get to the admin area what do you advice ?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You may have an error in functions.php somewhere around line 21.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cannot modify header information Error URGENT HELP Please’ is closed to new replies.