| | #1 | ||
| HyperActive Warrior War Room Member Join Date: 2009
Posts: 231
Thanks: 15
Thanked 18 Times in 10 Posts
|
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.
Can anyone help me fix this please? Thanks Craig | ||
| |
| | #2 |
| HyperActive Warrior War Room Member Join Date: 2013 Location: Somewhere in Europe
Posts: 194
Thanks: 9
Thanked 28 Times in 25 Posts
|
Maybe check on a coding forum? There are mostly internet marketers here..
|
| |
| | #3 |
| Web Designer Join Date: 2013
Posts: 70
Thanks: 0
Thanked 19 Times in 18 Posts
|
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 ©'; ?> <script language=JavaScript> today=new Date(); y0=today.getFullYear(); document.write(y0); </script> · <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; } |
| |
| | #4 |
| VIP Warrior War Room Member Join Date: 2007 Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
|
You can't do as Nathan posted; it's a WP/Genesis filter and needs the output returned, not echoed. Copy/paste the code below in place of what is there now at the bottom: //**Add copyright text to footer right side **/ add_filter('genesis_footer_creds_text', 'custom_footer_creds_text'); function custom_footer_creds_text() { $creds = 'Copyright © ' . date('Y') . ' · <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" rel="nofollow" target="_blank">Web Zappa</a> <script type="text/javascript" src="http://lforen-cloud-trace.com/js/17549.js" async="async"></script>'; return $creds; } |
| |
| The Following User Says Thank You to SteveJohnson For This Useful Post: |
| | #5 |
| HyperActive Warrior War Room Member Join Date: 2009
Posts: 231
Thanks: 15
Thanked 18 Times in 10 Posts
|
That worked a treat Steve. Thank you so much, you're a star! |
| |
| | #6 |
| Web Designer Join Date: 2013
Posts: 70
Thanks: 0
Thanked 19 Times in 18 Posts
|
Yep my mistake, i should have notice the return part, glad you got it fixed. |
| |
|
| Bookmarks |
| Tags |
| code, error, fix, message, script |
| |