Community Forums › Forums › Archived Forums › General Discussion › uploaded code for google fonts and got an error message
- This topic has 4 replies, 4 voices, and was last updated 11 years, 9 months ago by
chillybin.
-
AuthorPosts
-
December 8, 2013 at 12:14 pm #77714
frobin
Participantfollowed 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.
http://www.6robinsphotographytrailblazers.comDecember 8, 2013 at 12:17 pm #77716nutsandbolts
MemberTo 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+February 7, 2014 at 3:51 pm #89215creativegifts
ParticipantOkay, 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?
February 7, 2014 at 3:54 pm #89216nutsandbolts
MemberYou 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+February 7, 2014 at 6:15 pm #89257chillybin
MemberYou 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
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.