Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 添加带有无限卷轴的硬核分区砌体_Php_Wordpress_Html_Jquery Masonry_Infinite Scroll - Fatal编程技术网

Php 添加带有无限卷轴的硬核分区砌体

Php 添加带有无限卷轴的硬核分区砌体,php,wordpress,html,jquery-masonry,infinite-scroll,Php,Wordpress,Html,Jquery Masonry,Infinite Scroll,我在动态项目中使用带有无限滚动的砖石结构。。一切正常。。但当我使用if循环在动态div之间插入一个硬核div时,每当我向下滚动时,这个硬核div就会重复 用于插入核心div的PHP代码: <?php global $con; $con = 0; ?> . . . <?php if ($con==9) { ?> <div id="post-<?php the_ID(); ?>99yi" <?php post_clas

我在动态项目中使用带有无限滚动的砖石结构。。一切正常。。但当我使用if循环在动态div之间插入一个硬核div时,每当我向下滚动时,这个硬核div就会重复

用于插入核心div的PHP代码:

<?php
  global $con;
  $con = 0;    
?>
.
.
.
<?php
  if ($con==9) {    
?>
  <div id="post-<?php the_ID(); ?>99yi" <?php  post_class('thumb');?> style="border:none; margin-bottom:11px;">
    <div class="thumb-holder">
      The hardcore content comes here
    </div>
  </div>

<?php 
  }
?>
(function($){
            var $masonry = $('#masonry');

            $('#navigation').css({'visibility':'hidden', 'height':'1px'});

            $masonry.imagesLoaded( function(){
                $masonry.masonry({
                    itemSelector : '.thumb',
                    isFitWidth: true
                });
            });
        })(jQuery);

        jQuery(document).ready(function($){
            var $masonry = $('#masonry');

            $masonry.infinitescroll({
                navSelector : '#navigation',
                nextSelector : '#navigation #navigation-next a',
                itemSelector : '.thumb',
                loading: {
                    msgText: '',
                    finishedMsg: 'All items loaded',
                    img: 'http://www.abc.com/img/ajax-loader.gif',
                    finished: function() {},
                },
            }, function(newElements) {
                var $newElems = $(newElements).hide();

                $newElems.imagesLoaded(function(){
                    $('#infscr-loading').fadeOut('normal');
                    $newElems.show();
                    $masonry.masonry('appended', $newElems, true);
                });
            });

            $masonry.on('mouseenter', '.thumb-holder', function() {
                $(this).children('.masonry-actionbar').show();
            });

            $masonry.on('mouseleave', '.thumb-holder', function() {
                $(this).children('.masonry-actionbar').hide();
            });
        });
我陷入了这个问题。。有人知道如何解决这个问题吗。。提前感谢您的帮助……)