admin管理员组文章数量:1425783
EDIT: Answered own question with some fiddling around
Bit of a newbie question but sure someone here can help:
I am simply rubbish with JS but am learning on my feet.
I have created a simple codepen and want to use it in certain custom pages on my wordpress site.
The question is - how and where do I add the JS portion so that my site recognises it?
Also, at the bottom of the HTML portion is says:
<script src=".3.1/jquery.min.js"></script>
....which I assume will need to be added somewhere too?
Thanks.
EDIT: Answered own question with some fiddling around
Bit of a newbie question but sure someone here can help:
I am simply rubbish with JS but am learning on my feet.
I have created a simple codepen and want to use it in certain custom pages on my wordpress site.
The question is - how and where do I add the JS portion so that my site recognises it?
Also, at the bottom of the HTML portion is says:
<script src="https://cdnjs.cloudflare/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
....which I assume will need to be added somewhere too?
Thanks.
Share Improve this question edited May 30, 2019 at 11:40 Shaun21uk asked May 30, 2019 at 10:16 Shaun21ukShaun21uk 311 silver badge8 bronze badges 3- Stylesheets and scripts are necessary to your pen to work correctly. and wordpress have it's own way to inject script/style files called enqueuing. but in this case jQuery is already loaded by wordpress so you don't need to include jquery – Vishwa Commented May 30, 2019 at 10:59
- I see, so I can live without that line. So the css portion also seems to reference: maxcdn.bootstrapcdn/bootstrap/3.3.6/css/bootstrap.min.css I added this to my child theme functions.php as enqueue and it has broken my site. Man it seems like it should be such a simple task :/ – Shaun21uk Commented May 30, 2019 at 11:01
- Actually, it is.. it'll be even more simple once you get the hang of it. good luck :) – Vishwa Commented May 31, 2019 at 5:30
1 Answer
Reset to default 0All sorted.
My theme actually had a section for custom javascript in the theme options.
I added the code there and used the enqueue for the bootstrap - all working fine now.
本文标签: javascriptHow do I integrate a codepen
版权声明:本文标题:javascript - How do I integrate a codepen? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745451247a2658897.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论