July 7, 2013 at 3:11 am #49607
I've bought a plugin but unfortunately it is not a 'straight out the box' wordpress plugin and needs me to manually apply it. (My first time). I am a fast learner and don't mind breaking my site a few times in the learning process either. My question is this..
The person who wrote the plugin has told me I can upload the js files into the theme folder and then "use the functions.php file to embed the js and css files relative related". Its the second bit i am confused with. Do I really need to use the functions.php file? I have read codex etc and it tells me that the code you put into functions.php is only for adding code such as
into my wp_head():
With Genesis i can do this from my dashboard, so do I really need to mess around with the functions.php file? Or is this always necessary when adding some js to any wordpress site?
I am trying to keep the question non-specific to this one plugin so you can help. I'm sure the process of adding any js to genesis is the same, it is just not one i am familiar with.
July 7, 2013 at 3:13 am #49608
just to clarify (i tend to waffle)
into my wp_head(): through the dashboard, or do i need to insert it somehow using functions.php.
Note: I only actually need the js to load on one specific page of my site, if that changes anything.
July 7, 2013 at 4:54 am #49612
The way I would suggest loading it is via your functions file using a conditional tag() to only load on the specfic page you want to use your plugin on.
Hope this helps
July 7, 2013 at 5:55 am #49618
Use the Scripts box below each edit page/post screen or hook it in using a custom function with conditional tag:
You'll need to save the script as a .js file and place it in a new folder in your child themes directory named js or change the path to the file in the code.
Also, use the page-slug or post/page i.d in the conditional statement.
Brad Dalton has written 1961 Genesis tutorials & 4000+ Code Snippets .
You must be logged in to reply to this topic.