intégrer un scripts jquery sur wordpress
Bonjour, je souhaite intégrer mon script JS sur wordpress c'est pour l'utiliser sur mon formulaire plugin(contact form 7),
J'ai ajouter le lien sur le fichier footer.php :
Code:
1 2 3 4
|
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/js/1.7.1/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/js/Script.js"></script> <? php echo get_template_directory_uri ();?> |
voici mon code js:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
/*! jQuery script to hide certain form fields */
$(document).ready(function() {
//Hide the field initially
$("#hide1").hide();
//Show the text field only when the third option is chosen - this doesn't
$('#awesome').change(function() {
if ($("#awesome").val() == "Nope") {
$("#hide1").show();
}
else {
$("#hide1").hide();
}
});
}); |
voici le code de mon formulaire:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
<div id="contactForm">
<h2>Send us an email...</h2>
<ul>
<li>
<label for="awesome">Are you awesome?</label>[select* awesome id:awesome class:contactForm include_blank "Hell yes!" "Sometimes" "Nope"]
</li>
<li>
<div class="hide" id="hide1">
<label for="not-awesome">Tell us why not</label>[text* not-awesome id:not-awesome class:contactForm placeholder "Tell us why you aren't awesome"]
</div>
</li>
</ul>
</div> |
Merci,;)