Closed paulnett closed 12 years ago
The best practice in general, when it comes to altering or fitting a WordPress Theme is to create a Child Theme. This way you'd benefit from future updates to the Parent Theme (in this case The Bootstrap) without your changes being lost un update.
To just add the javascript, all you need would be a folder with your own style.css
and functions.php
files, where you'd add the javascript file and alter the font styles. See more about Child Themes.
I knew that.. should have thought twice before asking! So since the functions.php file in the child theme adds to the functions of the parent theme, I can use wp_enqueue_script() to add my javascript to the footer?
Don't worry about it. Glad I could help!
Yes, you can do that by passing true
as the fifth parameter. Keep in mind that the Child Theme's functions.php
gets loaded first, so if you have a file from the Parent Theme as a dependency, give your callback to the 'wp_enqueue_scripts'
action a lower priority (like 20), so the file will be there.
Great, I will do that! Also, should there be any issues with adding to my child themes .css file? I am not seeing the changes to the h tags. I added:
h1 { font-family: "john-doe",serif; }
For now, I have added the .js to the footer file. I can see they are loading fire bug.
Make sure your stylesheet gets included properly. Until v1.4.0 of The Bootstrap, Child Themes had to take care of that themselves.
I am able to select my child theme, so I am assuming that it's seeing the style.css file in my child themes directory. Is this what you are referring to? Thanks for the help.
I also added: @import url("../the-bootstrap/style.css"); to my child theme's style.css file.
Great, I hope everything worked out. Let me know when I can be of further assistance!
hi,
i was wondering how you would go about adding 'typekit' js? adding the scripts to the functions.php file or adding it directly to the footer.php file?
just wanted to get your take on what would be best practice with your theme, which i like a lot!
paul