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
Wordpress JetPack无限滚动在没有更多帖子时显示较旧的帖子按钮_Wordpress_Infinite Scroll_Jetpack - Fatal编程技术网

Wordpress JetPack无限滚动在没有更多帖子时显示较旧的帖子按钮

Wordpress JetPack无限滚动在没有更多帖子时显示较旧的帖子按钮,wordpress,infinite-scroll,jetpack,Wordpress,Infinite Scroll,Jetpack,我已经在WordPress主题中设置了无限滚动。我已将其设置为“单击”,以便用户必须单击才能加载更多帖子。我已经设置每页2篇文章,我有4篇文章总数 add_theme_support( 'infinite-scroll', array( 'type' => 'click', 'container' => 'news-wrap', 'footer' => 'false', 'footer_widgets

我已经在WordPress主题中设置了无限滚动。我已将其设置为“单击”,以便用户必须单击才能加载更多帖子。我已经设置每页2篇文章,我有4篇文章总数

add_theme_support( 'infinite-scroll', array(
    'type'           => 'click',
    'container'      => 'news-wrap',
    'footer'         => 'false',
    'footer_widgets' => 'false',
    'posts_per_page' => 2
) );
问题是,即使没有更多的帖子要加载,也会出现“旧帖子”按钮。因此,最初的页面加载,我看到两个帖子和按钮。单击按钮,再加载两篇文章,即使现在已加载所有4篇文章,该按钮仍会显示。再次单击,插件尝试加载更多帖子(没有),然后消失。显然,没有理由在第二次加载后显示该按钮