Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.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 WordPress在滚动/跳过上的查询帖子_Php_Jquery_Wordpress_Performance - Fatal编程技术网

Php WordPress在滚动/跳过上的查询帖子

Php WordPress在滚动/跳过上的查询帖子,php,jquery,wordpress,performance,Php,Jquery,Wordpress,Performance,我有一个网站,在主页上包含图像/滑块、标准页面内容等。一旦页面加载,它就会平滑地滚动。但我有一个关于查询和显示WordPress帖子的部分(见下面的代码)。当我在Google Chrome中查看它时,当我在该部分滚动时,网站会变得滞后/跳过,并且不会像主页的其他部分那样平滑滚动 有没有一种方法或东西可以让WordPress更快或更好地查询帖子,或者有没有其他原因导致该部分的滚动变得滞后 <?php $temp = $wp_query; $wp_query= null;

我有一个网站,在主页上包含图像/滑块、标准页面内容等。一旦页面加载,它就会平滑地滚动。但我有一个关于查询和显示WordPress帖子的部分(见下面的代码)。当我在Google Chrome中查看它时,当我在该部分滚动时,网站会变得滞后/跳过,并且不会像主页的其他部分那样平滑滚动

有没有一种方法或东西可以让WordPress更快或更好地查询帖子,或者有没有其他原因导致该部分的滚动变得滞后

<?php
    $temp = $wp_query; 
    $wp_query= null;
    $wp_query = new WP_Query(); 
    $wp_query->query('no_found_rows=true&showposts=6&post_status=publish' . '&paged='.$paged);
    while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
        <div class="newspagearticle full">
            <div class="newsthumb">
                <?php the_post_thumbnail( 'category-thumb' ); ?>
            </div>
            <div class="homenewsheader">
                <div class="newsdate">
                    <div><?php the_time('M') ?></div>
                    <?php the_time('d'); ?>
                </div>
                <h2>
                    <a class="readmore" href="<?php the_permalink() ?>">
                        <?php
                            $thetitle = $post->post_title; /* or you can use get_the_title() */
                            $getlength = strlen($thetitle);
                            $thelength = 200;
                            echo substr($thetitle, 0, $thelength);
                            if ($getlength > $thelength) echo "...";
                        ?>
                    </a>
                </h2>
            </div>
            <div style="clear:both;"></div>
            <?php the_excerpt(); ?>
        </div><!-- /newspagearticle -->
    <?php endwhile; ?>
    <?php wp_reset_postdata(); ?>


您正在加载多少篇文章?我在页面上只加载了6篇,但在后端有很多文章~200您是否尝试过使用chrome内置的分析工具?