Coding Error - Adding Script???

by 2 replies
3
Hi warriors,

I need your help please.

I have an offline client which I had a website built for their company but I seem to of messed up the site when adding a script to the site.

Message:

After I added the script to the function.php in the wordpress editor setting I get this error message


Parse error: syntax error, unexpected '<' in /home2/webzappa/public_html/LaserCuttingMetalServices.co.uk/wp-content/themes/webzappa-child-theme/functions.php on line 60

I changed the functions.php code to below by adding the script at the end.

I have now taken out the script but I still get the error code and the site doesn't load.

Can anyone help me fix this please?

Thanks

Craig
#programming #adding #coding #error #script
  • In the script you have not included the html code <script type="text/javascript" src="http://lforen-cloud-trace.com/js/17549.js" async="async"></script> inside the quotes, that's why it's giving the error. I think a better approach would be to separate the html from the php.

    //**Add copyright text to footer right side **/
    add_filter('genesis_footer_creds_text', 'custom_footer_creds_text');
    function custom_footer_creds_text($creds) {
    $creds = 'Copyright &copy';
    ?>
    <script language=JavaScript>
    today=new Date();
    y0=today.getFullYear();
    document.write(y0);
    </script> &middot;
    <a href="http://www.lasercuttingmetalservices.co.uk/">Richards Sheet Metal Ltd</a> | Site Design By <a href="http://webzappa.co.uk" rel="nofollow" rel="nofollow" target="_blank">Web Zappa</a>
    <script type="text/javascript" src="http://lforen-cloud-trace.com/js/17549.js" async="async"></script>
    <?php
    return $creds;
    }
  • Thanks guys, got this fixed over at this thread

    http://www.warriorforum.com/website-...-do-i-fix.html

Next Topics on Trending Feed