Filter by 카테고리

아바다 테마 안쓰는 스크립트 제거

()


테마는 하위 테마 또는 사용자 지정 플러그인에서 스크립트를 수동으로 등록 취소 할 수있는 클래스를 제공합니다. 다음은 모두 제거하는 예입니다.

add_action ( ‘wp_enqueue_scripts’, ‘custom_disable_theme_js’);

function custom_disable_theme_js () {
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-chartjs’);
}

테마는 100 개가 넘는 개별 스크립트에로드되며 일부는 사이트의 기능에 필요할 수 있으므로 다른 스크립트는 제외하고 필요에 따라 선택적으로 다시 추가하는 것이 최선의 방법이라는 것을 알았습니다. 이 접근 방식을 사용하여이 접근 방식을 구현 한 경우 100 개의 JS 호출과 1.2MB의 불필요한로드를 제거 할 수있었습니다.

다음은 초기 화면의 전체 목록입니다.

Fusion_Dynamic_JS :: deregister_script ( ‘avada-comments’);
Fusion_Dynamic_JS :: deregister_script ( ‘avada-general-footer’);
Fusion_Dynamic_JS :: deregister_script ( ‘avada-mobile-image-hover’);
Fusion_Dynamic_JS :: deregister_script ( ‘avada-quantity’);
Fusion_Dynamic_JS :: deregister_script ( ‘avada-scrollspy’);
Fusion_Dynamic_JS :: deregister_script ( ‘avada-select’);
Fusion_Dynamic_JS :: deregister_script ( ‘avada-sidebars’);
Fusion_Dynamic_JS :: deregister_script ( ‘avada-tabs-widget’);

Fusion_Dynamic_JS :: deregister_script ( ‘bootstrap-collapse’);
Fusion_Dynamic_JS :: deregister_script ( ‘bootstrap-modal’);
Fusion_Dynamic_JS :: deregister_script ( ‘bootstrap-popover’);
Fusion_Dynamic_JS :: deregister_script ( ‘bootstrap-scrollspy’);
Fusion_Dynamic_JS :: deregister_script ( ‘bootstrap-tab’);
Fusion_Dynamic_JS :: deregister_script ( ‘bootstrap-tooltip’);
Fusion_Dynamic_JS :: deregister_script ( ‘bootstrap-transition’);

Fusion_Dynamic_JS :: deregister_script ( ‘cssua’);

Fusion_Dynamic_JS :: deregister_script ( ‘fusion-alert’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-blog’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-button’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-carousel’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-chartjs’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-column-bg-image’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-count-down’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-equal-heights’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-flexslider’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-image-before-after’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-lightbox’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-parallax’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-popover’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-recent-posts’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-sharing-box’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-syntax-highlighter’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-testimonials’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-title’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-tooltip’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-video-bg’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-video-general’);
Fusion_Dynamic_JS :: deregister_script ( ‘fusion-waypoints’);

Fusion_Dynamic_JS :: deregister_script ( ‘images-loaded’);
Fusion_Dynamic_JS :: deregister_script ( ‘isotope’);

Fusion_Dynamic_JS :: deregister_script ( ‘jquery-appear’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-caroufredsel’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-count-down’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-count-to’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-cycle’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-easing’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-easy-pie-chart’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-event-move’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-fade’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-flexslider’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-fitvids’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-fusion-maps’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-hover-flow’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-hover-intent’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-infinite-scroll’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-lightbox’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-mousewheel’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-placeholder’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-request-animation-frame’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-sticky-kit’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-to-top’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-touch-swipe’);
Fusion_Dynamic_JS :: deregister_script ( ‘jquery-waypoints’);

Fusion_Dynamic_JS :: deregister_script ( ‘lazysizes’);
Fusion_Dynamic_JS :: deregister_script ( ‘modernizr’);
Fusion_Dynamic_JS :: deregister_script ( ‘packery’);
Fusion_Dynamic_JS :: deregister_script ( ‘vimeo-player’);

테마는 수시로 업데이트되므로이 목록은 변경 될 수 있습니다. 메인 테마 폴더에서 등록 해제하려는 JS 파일의 이름을 grep하여 핸들이 무엇인지 알아낼 수 있습니다.

이 게시물은 얼마나 유용했습니까?

별을 클릭하여 등급을 매깁니다!

평균 평점 / 5. 투표 수:

지금까지 투표가 없습니다! 이 게시물을 평가하는 첫 번째 사람이 되세요.

리플 남기기