- This topic has 5 replies, 2 voices, and was last updated 10 years, 3 months ago by
Theme Horse Support Team.
-
AuthorPosts
-
March 26, 2015 at 9:04 pm #23545
Bill
ParticipantI have logo-links to Angie’s List, the Chamber of Commerce and the Better Business Bureau that require JavaScript to run properly. Is there a way to make this work in the footer or a work around to make it look like a footer. I bought premium in order to be able to customize the footer, but without this capability, it doesn’t really solve my problem. Can someone help me?
Thanks,
Bill
March 27, 2015 at 5:34 am #23553Theme Horse Support Team
KeymasterHi Bill,
We recommended not to change the code because if you change the code then while updating to our new version all your customisation code will be lost. So better make child theme and first unhook the functions and the edit the code.http://codex.wordpress.org/Child_Themes
You may try this below code.function attitude_javascripts() { wp_enqueue_script( 'the-script-handle', 'path/to/file.js', array( 'jquery','other_script_that_we_depend_on' ), 'scriptversion eg. 1.0', true); } add_action( 'wp_enqueue_scripts', 'attitude_javascripts' );
If you are unable to add then you may hire a developer to fix it.
Thank you!
March 27, 2015 at 5:39 pm #23568Bill
ParticipantI already use a child theme, I set that up right away. I added this function to the functions.php file and it isn’t working. Is there something that I may be missing?
Thanks, Bill
March 30, 2015 at 6:09 am #23633Theme Horse Support Team
KeymasterHi Bill,
Add this code inside child theme of attitude- pro
Ceate a style.css file and add this below code.,/* Theme Name: Attitude Child Theme Author: Self-Help Theme Horse Template: Attitude Pro Child */ /*@import url("../attitude/style.css"); */
After doing it create one functions.php file inside child theme.
function attitude_javascripts() { wp_enqueue_script( 'backtotop', ATTITUDE_JS_URL. '/backtotop.js', array( 'jquery' ) ); // this is an example } add_action( 'wp_enqueue_scripts', 'attitude_javascripts' );
If you are still unable the you need to hire a developer to fix it.
Thank you!
March 30, 2015 at 11:51 pm #23655Bill
ParticipantThank you, but it didn’t work. I even uncommented out the @import URL… in the CSS file. I already had both style.css and functions.php files in the child theme. Will you consider allowing Javascript to run natively in the footer in the next update?
Thanks, Bill
March 31, 2015 at 5:03 am #23658Theme Horse Support Team
KeymasterHi Bill,
We are sorry for this. You may simply add your javascript inside footer.php if you want but while updating each and everytime you need to do the same things.
Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.