uploaded code for google fonts and got an error message

Community Forums Forums General Discussion uploaded code for google fonts and got an error message

This topic is: not resolved

This topic contains 4 replies, has 4 voices, and was last updated by  chillybin 6 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #77714

    frobin
    Participant
    Post count: 9

    followed the instructions to upload google fonts. When I save and refreshed my page I got this error message,

    error message: Parse error: syntax error, unexpected $end in /home/fromlond/public_html/6robinsphotographytrailblazers.com/wp-content/themes/executive-pro/functions.php on line 206

    How can I undo the code in order to restore my site.

    I followed these instructions:

    We now use and recommend this new method. Open up the functions.php file of one of our child themes and place the following code:

    1
    2
    3
    4
    5
    6
    7
    8
    <?php
    //* Do NOT include the opening php tag

    //* Enqueue Lato Google font
    add_action( ‘wp_enqueue_scripts’, ‘sp_load_google_fonts’ );
    function sp_load_google_fonts() {
    wp_enqueue_style( ‘google-font-lato’, ‘//fonts.googleapis.com/css?family=Lato:300,700′, array(), CHILD_THEME_VERSION );
    }

    view raw functions.php hosted with ❤ by GitHub

    The code you see above will load a Google Font style sheet and will also include the Lato Font in weights of 300 and 700. And that’s all there is to it.

    • This topic was modified 8 months, 2 weeks ago by  frobin.
    • This topic was modified 8 months, 2 weeks ago by  frobin.
    http://www.6robinsphotographytrailblazers.com
    #77716

    nutsandbolts
    Moderator
    Post count: 3113

    To remove the code from functions.php, you’ll need to access your files either via FTP or your host’s file manager and edit the file that way.

    This is the only part that should have been pasted into your functions file:

    //* Enqueue Lato Google font
    add_action( ‘wp_enqueue_scripts’, ‘sp_load_google_fonts’ );
    function sp_load_google_fonts() {
    wp_enqueue_style( ‘google-font-lato’, ‘//fonts.googleapis.com/css?family=Lato:300,700′, array(), CHILD_THEME_VERSION );
    }

    If any of the rest got pasted in, that will explain the parse error.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #89215

    creativegifts
    Participant
    Post count: 2

    Okay, I did the same thing. I can download my functions.php file via my cpanel. How in the world do I open it in order to delete the code that I added based on your instructions?

    #89216

    nutsandbolts
    Moderator
    Post count: 3113

    You should be able to open it in a basic text editor – don’t use MS Word or anything because it will add formatting to it.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #89257

    chillybin
    Participant
    Post count: 81

    You can edit in cPanel, or download something like Notepad++ on Windows


    We are a web design & development consultancy based in Singapore who specialise in all things WordPress & Genesis. | ChillyBin Web Design & Consultancy: http://www.chillybin.com.sg | Twitter: @chillybindesign

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.