<script type="text/javascript">
jQuery(function( $ ) {
//Mail
$('.successfulform').hide();
$(document).ready(function () {
$(".form_tab form").submit(function () {
var formID = $(this).attr('id');
var formNm = $('#' + formID);
$.ajax({
type: "POST",
url: '<?php bloginfo('template_url'); ?>/mail.php',
data: formNm.serialize(),
success: function (data) {
$('.successfulform').show('1000');
document.forms['formMain'].reset();
},
error: function (jqXHR, text, error) {
$(formNm).html(error);
}
});
return false;
});
});
// Hide .successfulform
$(document).ready(function() {
$(".successclose").click(function(){
$(".successfulform").slideToggle("slow");
});
});
});
</script>
<?php
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query('showposts=-1&post_type=post'.'&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post();
?>
<!-- тут js код -->
<?php endwhile; ?>
<?php
$wp_query = null;
$wp_query = $temp;
?>