{"action":"created","issue":{"url":"https://api.github.com/repos/dcooney/wordpress-ajax-load-more/issues/87","labels_url":"https://api.github.com/repos/dcooney/wordpress-ajax-load-more/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/dcooney/wordpress-ajax-load-more/issues/87/comments","events_url":"https://api.github.com/repos/dcooney/wordpress-ajax-load-more/issues/87/events","html_url":"https://github.com/dcooney/wordpress-ajax-load-more/issues/87","id":100567589,"number":87,"title":"Load only on certain pages?","user":{"login":"hayespotter","id":309545,"avatar_url":"https://avatars.githubusercontent.com/u/309545?v=3","gravatar_id":"","url":"https://api.github.com/users/hayespotter","html_url":"https://github.com/hayespotter","followers_url":"https://api.github.com/users/hayespotter/followers","following_url":"https://api.github.com/users/hayespotter/following{/other_user}","gists_url":"https://api.github.com/users/hayespotter/gists{/gist_id}","starred_url":"https://api.github.com/users/hayespotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hayespotter/subscriptions","organizations_url":"https://api.github.com/users/hayespotter/orgs","repos_url":"https://api.github.com/users/hayespotter/repos","events_url":"https://api.github.com/users/hayespotter/events{/privacy}","received_events_url":"https://api.github.com/users/hayespotter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-12T15:17:02Z","updated_at":"2015-08-12T19:21:42Z","closed_at":null,"body":"Is there a way to make the javascript file only load on pages where I'm using lazy load? I don't want extra javascript loading when it's not needed."},"comment":{"url":"https://api.github.com/repos/dcooney/wordpress-ajax-load-more/issues/comments/130417311","html_url":"https://github.com/dcooney/wordpress-ajax-load-more/issues/87#issuecomment-130417311","issue_url":"https://api.github.com/repos/dcooney/wordpress-ajax-load-more/issues/87","id":130417311,"user":{"login":"hayespotter","id":309545,"avatar_url":"https://avatars.githubusercontent.com/u/309545?v=3","gravatar_id":"","url":"https://api.github.com/users/hayespotter","html_url":"https://github.com/hayespotter","followers_url":"https://api.github.com/users/hayespotter/followers","following_url":"https://api.github.com/users/hayespotter/following{/other_user}","gists_url":"https://api.github.com/users/hayespotter/gists{/gist_id}","starred_url":"https://api.github.com/users/hayespotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hayespotter/subscriptions","organizations_url":"https://api.github.com/users/hayespotter/orgs","repos_url":"https://api.github.com/users/hayespotter/repos","events_url":"https://api.github.com/users/hayespotter/events{/privacy}","received_events_url":"https://api.github.com/users/hayespotter/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T19:21:42Z","updated_at":"2015-08-12T19:21:42Z","body":"I came up with this solution\r\n\r\nfunction kill_alm() {\r\n\r\n\tif ( !is_archive() && !is_home() ) {\r\n\r\n\t\tadd_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );\r\n\r\n\t\tfunction my_deregister_javascript() {\r\n\t\t\twp_deregister_script( 'ajax-load-more' );\r\n\t\t}\r\n\t}\r\n\r\n}\r\n\r\nadd_action( 'wp', 'kill_alm');"}}