커다란 스크립트가 바닥 글의 하단에 하드 코딩되어 있습니다.functions.php에 스크립트를 넣고 호출하는 방법
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>
나는 나의 functions.php 파일에 넣어 그리고 가능하다면 그냥 작동합니다 /이 시점에서 그것을 호출 할.
[클라이언트 측 프로그래밍과 서버 측 프로그래밍의 차이점은 무엇입니까?] (http://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and) -server-side-programming) – Epodax
왜 하나의 .js 파일을 만들지 않고 여기에 포함시킬 것입니까 –
다른 .js 파일과 함수 파일 등이 있습니다. 그 중 하나에 넣고 싶습니다. function.php는 다음과 같습니다. 최고 – user3550879