-
AuthorPosts
-
January 11, 2016 at 2:09 pm #563122
Hello,
how can i do insert jquery code in wordpress widget area enfold theme? I use some plugins but doesn’t work.
Can you suggest me any plugin for widget area or how to connect an external javascript file to wordpress?
The code.
—————————-
<!DOCTYPE html>
<html>
<head><style>
#button_style {
background-color: #2d2d2d;
color: #fff;
padding: 6px 15px;
}
</style><script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js”></script>
<script>
$(document).ready(function(){
$(“button”).click(function(){
$(“p”).toggle(1000);
});
});
</script></head>
<body><button id=”button_style”>Frequency Questions</button>
<p>First Question</p>
<p>Second Question</p>
<p>Third Question</p></body>
</html>
—————————-Thank you
-
This topic was modified 9 years, 10 months ago by
Isakos-Soft.
January 11, 2016 at 2:16 pm #563136Hey Isakos-Soft!
Please add following code to Functions.php file in Appearance > Editor
function add_custom_code(){ ?> <script> jQuery(document).ready(function(){ jQuery("button").click(function(){ jQuery("p").toggle(1000); }); }); </script> <?php } add_action('wp_footer', 'add_custom_code');Cheers!
YigitJanuary 11, 2016 at 3:12 pm #563193Sorry, don’t work right.
I add this button in Appearance – Widgets – Displayed Everywhere (sidebar), Visual Editor title FQ.
I want to work like toggle button. Repeat Show – Hide paragraph text.
January 11, 2016 at 3:38 pm #563216Sorry, the code work perfectly. I fix it. I add class in paragraph.
Thank you
January 11, 2016 at 3:41 pm #563221Hi!
You are welcome!
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)Regards,
Yigit -
This topic was modified 9 years, 10 months ago by
-
AuthorPosts
- The topic ‘Insert JQuery Code in WordPress Enfod Theme’ is closed to new replies.
