$(document).ready(function() {
var $boxes = $('.loop');
$boxes.hide();
var $container = $('#content_masonry');
$container.imagesLoaded( function() {
$boxes.fadeIn();
$container.masonry({
itemSelector : '.loop',
columnwidth: 330,
gutter: 30,
isFitWidth: true,
isAnimated: !Modernizr.csstransitions
});
});
});
<article class="loop">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail('thumbnail'); }
else { ?>
<img src="<?php echo first_post_image() ?>" alt="<?php the_title(); ?>" />
<?php } ?>
<div class="excerpt"><?php the_excerpt() ?></div>
<div class="title">
<div class="post-click-popup"><span><?php echo $post->ID; ?></span></div>
<h2 class="title-2"><a class="popup-post-modal-open" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
</div>
</article>
<section id="content">
<?php if ( have_posts() ) { ?>
<div class="boxcontainer"><div class="box"></div>
<h3 class="title-3"><?php single_cat_title(); ?></h3>
<?php while ( have_posts() ) { the_post(); ?>
<?php get_template_part('pinbox'); ?>
<?php } ?>
</div>
<?php
ob_start();
posts_nav_link(' ', __('Previous Page', 'pinthis'), __('Next Page', 'pinthis'));
$pinthis_posts_nav_link = ob_get_clean();
?>
<?php if(strlen($pinthis_posts_nav_link) > 0) { ?>
<div class="posts-navigation clearfix <?php if ($pinthis_infinite_scroll == 1) { ?>hide<?php } ?>"><?php echo $pinthis_posts_nav_link; ?></div>
<?php } ?>
<?php } else { ?>
<div class="notification-body">
<p class="notification tcenter"><?php echo __('No posts found.', 'pinthis'); ?></p>
</div>
<?php } ?>
</section>
<section id="content">
<?php if ( have_posts() ) { ?>
<div class="boxcontainer">
<?php
$args = array(
'meta_query' => array(
'meta_value_num' => array(
'key' => 'popularity'
),
),
'orderby' => 'meta_value_num',
'post_status' => 'publish',
'order' => 'DESC'
);
$query = new WP_Query( $args );
while ($query->have_posts()) : $query->the_post(); ?>
<?php get_template_part('pinbox', get_post_format()); ?>
<?php endwhile; ?>
</div>
<?php
ob_start();
posts_nav_link(' ', __('Previous Page', 'pinthis'), __('Next Page', 'pinthis'));
$pinthis_posts_nav_link = ob_get_clean();
?>
<?php if(strlen($pinthis_posts_nav_link) > 0) { ?>
<div class="container">
<div class="posts-navigation clearfix <?php if ($pinthis_infinite_scroll == 1) { ?>hide<?php } ?>"><?php echo $pinthis_posts_nav_link; ?></div>
</div>
<?php } ?>
<?php } else { ?>
<div class="notification-body">
<p class="notification tcenter"><?php echo __('No posts found.', 'pinthis'); ?></p>
</div>
<?php } ?>
</section>
// получаем дату публикации поста в секундах начиная с 1 января 1970 года
$dtNow = get_post_time('U', true, $postid);
// получаем текущее время
$dtTime = current_time('U');
// считаем разницу в днях
$diff = $dtTime - $dtNow;
$days = $diff/86400;
comments_number( '0', '1', '%' );
var $block = $('#lk-conteyner'),
blockPos = $('#lk-conteyner').offset().top;
$(window).scroll(function(){
var currentScroll = $(this).scrollTop();
console.log(currentScroll);
if ( currentScroll > blockPos ) {
$block.slideUp(200);
} else {
$block.slideDown();
$('header').addClass('cont_header');
}
$('header').removeClass('cont_header');
});
Спасибо, сделал все и так:
Без видимых изменений