Add Google Font to Nelo Theme

Hi, I've found a spot in the functions.php file of the Nelo Theme where links to Google Fonts are included. The Font I want to use, Open Sans, is not included in the theme by default. So, I wanted to try and add it to the functions.php file.

I've added a line that looks like this:

<?php } else if ($bodytype == "Open Sans, arial, serif"){ ?>
<link target='_blank' href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'/>

In 3 different spots where Google Fonts are located. But Open Sans doesn't appear in the drop down theme options. Am I doing this correctly?

  • Tom Eagles

    @karks88

    Would you mind checking that you have definitely not overwritten the parts of the code at the bottom of each section ie the closing <?php }

    I have added the complete code below.
    Cheers

    Tom

    if ($bodytype == ""){ ?>
    <?php } else if ($bodytype == "Cantarell, arial, serif" ){ ?>
    <link href='http://fonts.googleapis.com/css?family=Cantarell' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Cardo, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Cardo' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Crimson Text, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Crimson+Text' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Droid Sans, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Droid Serif, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "IM Fell DW Pica, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=IM+Fell+DW+Pica' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Josefin Sans Std Light, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Josefin+Sans+Std+Light' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Lobster, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Molengo, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Molengo' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Neuton, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Neuton' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Nobile, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Nobile' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "OFL Sorts Mill Goudy TT, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=OFL+Sorts+Mill+Goudy+TT' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Reenie Beanie, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Reenie+Beanie' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Tangerine, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Tangerine' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Old Standard TT, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Old+Standard+TT' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Volkorn, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Volkorn' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Yanone Kaffessatz, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Just Another Hand, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Just+Another+Hand' rel='stylesheet' type='text/css'>
    <?php } else if ($bodytype == "Terminal Dosis Light, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Terminal+Dosis+Light' rel='stylesheet' type='text/css'>
    <?php } else if ($bodytype == "Ubuntu, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Ubuntu:light,regular,bold' rel='stylesheet' type='text/css'>
    <?php } else if ($bodytype == "Open Sans, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'/>
    <strong><?php }</strong>
    if ($navtype == ""){ ?>
    <?php } else if ($navtype == "Cantarell, arial, serif" ){ ?>
    <link href='http://fonts.googleapis.com/css?family=Cantarell' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Cardo, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Cardo' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Crimson Text, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Crimson+Text' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Droid Sans, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Droid Serif, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "IM Fell DW Pica, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=IM+Fell+DW+Pica' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Josefin Sans Std Light, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Josefin+Sans+Std+Light' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Lobster, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Molengo, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Molengo' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Neuton, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Neuton' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Nobile, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Nobile' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "OFL Sorts Mill Goudy TT, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=OFL+Sorts+Mill+Goudy+TT' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Reenie Beanie, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Reenie+Beanie' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Tangerine, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Tangerine' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Old Standard TT, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Old+Standard+TT' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Volkorn, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Volkorn' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Yanone Kaffessatz, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz' rel='stylesheet' type='text/css'/>
    <?php } else if ($navtype == "Just Another Hand, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Just+Another+Hand' rel='stylesheet' type='text/css'>
    <?php } else if ($navtype == "Terminal Dosis Light, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Terminal+Dosis+Light' rel='stylesheet' type='text/css'>
    <?php } else if ($navtype == "Ubuntu, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Ubuntu:light,regular,bold' rel='stylesheet' type='text/css'>
    <?php } else if ($bodytype == "Open Sans, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'/>
    <?php } else if ($bodytype == "Open Sans, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'/>
    <strong><?php }</strong>
    if ($headtype == ""){ ?>
    <?php } else if ($headtype == "Cantarell, arial, serif" ){ ?>
    <link href='http://fonts.googleapis.com/css?family=Cantarell' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Cardo, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Cardo' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Crimson Text, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Crimson+Text' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Droid Sans, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Droid Serif, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "IM Fell DW Pica, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=IM+Fell+DW+Pica' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Josefin Sans Std Light, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Josefin+Sans+Std+Light' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Lobster, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Molengo, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Molengo' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Neuton, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Neuton' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Nobile, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Nobile' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "OFL Sorts Mill Goudy TT, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=OFL+Sorts+Mill+Goudy+TT' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Reenie Beanie, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Reenie+Beanie' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Tangerine, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Tangerine' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Old Standard TT, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Old+Standard+TT' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Volkorn, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Volkorn' rel='stylesheet' type='text/css'/>
    <?php } else if ($headtype == "Yanone Kaffeesatz, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz' rel='stylesheet' type='text/css'>
    <?php } else if ($headtype == "Just Another Hand, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Just+Another+Hand' rel='stylesheet' type='text/css'>
    <?php } else if ($headtype == "Terminal Dosis Light, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Terminal+Dosis+Light' rel='stylesheet' type='text/css'>
    <?php } else if ($headtype == "Ubuntu, arial, serif"){ ?>
    <link href='http://fonts.googleapis.com/css?family=Ubuntu:light,regular,bold' rel='stylesheet' type='text/css'>
    <?php }
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'/>
    <strong><?php }</strong>

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.