I have a large script hard-coded in the bottom of my footer.
html (footer.php)
<script>
jQuery(document).ready(function($){
// anchor scrolling /
function filterPath(string) {
return string
.replace(/^\//,'')
.replace(/(index|default).[a-zA-Z]{3,4}$/,'')
.replace(/\/$/,'');
}
var locationPath = filterPath(location.pathname);
var scrollElem = scrollableElement('html', 'body');
...
</script>
</body>
</html>
I want to put it in my functions.php file and just call it at this point if that is possible/will it work.