WordPress.org

Ready to get started?Download WordPress

Forums

Boilerplate
Adding scripts (3 posts)

  1. alvaro05
    Member
    Posted 2 years ago #

    I've been using tanzaku theme before. With this theme (I believe as with others) to add a script I had to do it in the before the </head> tag in header.php . This way (for example):

    <script type="text/javascript">
    jQuery.noConflict();
    (function($){
      $(function(){
        $('.whatever').css("display","none");
      });
    });
    </script>

    But I can't figure out how to make it with Boilerplate theme.
    What am I doing wrong?
    Thanks in advance!

    http://wordpress.org/extend/themes/boilerplate/

  2. Zenvied
    Member
    Posted 2 years ago #

    Hey Alvaro,

    If you go under Appearance -> Boilerplate Admin you will find a checkbox to activate site-specific scripts (script-starter.js). The file is located in the boilerplate theme directory under the js folder. There you will just add your code and you should be good to go.

    Cheers.

  3. Aaron T. Grogg
    Member
    Theme Author

    Posted 2 years ago #

    Thanks, Zenvied.

    Alvaro: In keeping with best-practices, Boilerplate natively loads jQuery at the end of the <body>, so if you want to use jQuery in the <head>, look for another checkbox under the jQuery section that allows you to move jQuery to the <head>.

    Additionally, once you add your code to the script-starter.js file, you will need to rename that file as script.js. This will allow you to perform upgrades in the future without overwriting your scripts file.

    Cheers,
    Atg

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic