Support » Allgemeine Fragen » Use JS-files from functions.php just on certain templates / pages

  • peesen87

    (@peesen87)


    Hello everyone

    I have a lot of site specific JavaScript-files i just want to load on certain templates. Currently i load all the scripts with:

    function footer_scripts()
    {
    	// If query if current Page is not wp-login-php or admin page
        if ($GLOBALS['pagenow'] != 'wp-login.php' && !is_admin()) {
            // ALL SCRIPTS
        }
    }
    
    add_action('init', 'footer_scripts');

    Thank you so much for your help!

Ansicht von 1 Antwort (von insgesamt 1)
  • Moderator Bego Mario Garde

    (@pixolin)

    Moderation Note:

    I have closed this thread because you asked your question in English in the German support forums. To keep the threads accessible for users who don’t speak English, please ask your question in German or post it in the international support forums. Thanks for your understanding.

Ansicht von 1 Antwort (von insgesamt 1)
  • Das Thema „Use JS-files from functions.php just on certain templates / pages“ ist für neue Antworten geschlossen.