HEX
Server: nginx/1.24.0
System: Linux iZm5eic9piryinoecjybjoZ 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: www (1000)
PHP: 8.2.28
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/h3.iyingtaos.cn/wp-content/themes/three-picture/templates/loading.php
<script>
 $(document).ready(function() {  
    var page = 2; // 初始页码为2,因为第一页已经在HTML中加载  
    var loading = false; // 防止重复请求  
    $(window).scroll(function() {  
        if ($(window).scrollTop() + $(window).height() >= $(document).height() - 500 && !loading) { // 当用户滚动到底部100px以内时触发  
            loading = true;  
            $('.loading-indicator').show();
            $.ajax({  
                url:'<?php echo admin_url('admin-ajax.php'); ?>', // WordPress全局变量,指向wp-admin/admin-ajax.php  
                type: 'POST',  
                data: {  
                    action: 'infinite_scroll', // 与后台的add_action匹配  
                    page: page,
                    category_id: '<?php echo get_queried_object_id(); ?>',
                    fenlei : '<?php echo single_cat_title('');?>'
                },  
                success: function(response) {  
                    if (response.success && response.data ) {
                        $('.main-box').append(response.data.content);  // 将新内容追加到现有内容中
                        page++;  
                    } else {  
                        // 如果没有更多内容,可以禁用滚动事件或显示一个消息  
                        $(window).off('scroll');  
                        $('.main-box').append('<div style="text-align:center;">没有更多文章</div>').show()
                    }  
                    $('.loading-indicator').hide();
                    loading = false;  
                },  
            });  
        }  
    });  
});  
</script>