I have a HTML/CSS form which requires an external Javascript. I have the HTML on my required page with linking code to the javascript. I have a wordpress website and I just put the folder with the javascript in Public_HTML. Is this correct, it is not working for some reason? Code in HTML:
<script src="csgoboost/js/jquery.js"></script>
<script src="csgoboost/js/bootstrap.min.js"></script>
<script src="csgoboost/js/boosting.js"></script>
Thank (I am a bit of a beginner)
asked Mar 3, 2016 at 7:58
Oliver Beck
3291 gold badge3 silver badges7 bronze badges
-
Might be the path issue. see if it included properlyMaha Dev– Maha Dev2016年03月03日 08:01:39 +00:00Commented Mar 3, 2016 at 8:01
-
you need to learn first template hierarchy of wordpress before implementing. template hierarchy and directory structureNoman– Noman2016年03月03日 08:06:51 +00:00Commented Mar 3, 2016 at 8:06
-
1Possible duplicate of Adding custom JavaScript, CSS and HTML to WordPresspeszo– peszo2016年03月03日 08:09:48 +00:00Commented Mar 3, 2016 at 8:09
1 Answer 1
if you are using wordpress then put the js folder in themes folder like
public_html/wp-content/themes/yourThemeName/js-folder
and then call the
<script src="<?php echo get_template_directory_uri();?>/js-folder/file.js"></script>
Noman
4,1361 gold badge23 silver badges37 bronze badges
answered Mar 3, 2016 at 8:06
Piyush Dhanotiya
5795 silver badges18 bronze badges
Sign up to request clarification or add additional context in comments.
6 Comments
Oliver Beck
Hello, I've done shat your told me to but it seems like it still doesn't work.. =(
Oliver Beck
I know, I have put the JS folder in there
Piyush Dhanotiya
in the header.php file or footer.php file you call this function <script src="<?php echo get_template_directory_uri();?>/js-folder/file.js"></script>
Oliver Beck
Oh I put it in the page with my HTML form. Do I also put it in the header?
Piyush Dhanotiya
Put in header or footer.
|
default