<?php $idx = 0; ?>
<?php $num_per_group = 3; ?>
<?php $manual_catalog_count = $manual_catalog->post_count; ?>
<div class="row-fluid">
<?php while( $manual_catalog->have_posts() ) : $manual_catalog->the_post(); ?>
<div class="span4 document-info">
<div class="-col-2 inline-block"><i class="file-big-icon-default file-big-icon-pdf"></i></div>
<div class="-col-9 inline-block"><a href="" target="_blank"></a>
<div class="infoDigits"><b></b>, </div>
</div>
</div>
<?php echo (++$idx) % $num_per_group == 0 ? '</div> <div class="row-fluid">' : '' ?>
<?php endwhile; ?>
</div>
$comments
ничего нет, то выводим «Отзывов нет»<?php $comments = array_filter($comments, function ($comment) {
return (bool)$comment['comment_approved'] === true;
}});?>
<?php if ($comments): ?>
<?php foreach ( $comments as $comment ): ?>
<?= $comment['...']; ?>
<?php endforeach; ?>
<?php else : ?>
Отзывов нету
<?php endif; ?>
img.onload = function() {
canvas.width = img.width;
canvas.height = img.height;
ctx.drawImage(img, 0, 0, img.width, img.height);
};
$(document).on('submit', 'form', function(e) {
e.preventDefault();
if ( !formValidate(this) ) return;
console.log('send.')
$.ajax({
type: "POST",
url: 'url',
data: '',
success: function(data) {
console.log(data);
},
error: function(e) {
console.warn(e);
}
});
});
function formValidate(form) {
for (var i = 0; i < form.children.length; i++) {
if (form.children[i].type !== 'submit' && form.children[i].value.length === 0) {
// form.children[i].value.length === 0
// это условие можно модифицировать
console.log('bad value in', form.children[i]);
form.children[i].focus();
return false;
}
}
return true;
}
window.addEventListener('scroll', event => {
if (scrollY + innerHeight === document.body.scrollHeight) {
// Code here
}
});
$("input").keydown(function(event){
if (event.keyCode === 13) {
return false;
}
}
$('.block-two').eq(index).append(blockImage + blockTitle);
меняете на $('.block-two').eq(index).append(blockImage, blockTitle);