Wordpress 自定义页面导航在除Safari之外的所有浏览器中都能完美运行

Wordpress 自定义页面导航在除Safari之外的所有浏览器中都能完美运行,wordpress,Wordpress,我在WP-theme-functions.php页面中使用了以下代码,它在所有浏览器中都能完美工作,但并不总是在Safari中显示,因为它是间歇性的 当它没有显示在页面上时,如果我查看源代码,它就在代码中 function custom_wp_pagenavi($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) { global $requ

我在WP-theme-functions.php页面中使用了以下代码,它在所有浏览器中都能完美工作,但并不总是在Safari中显示,因为它是间歇性的

当它没有显示在页面上时,如果我查看源代码,它就在代码中

function custom_wp_pagenavi($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
    global $request, $posts_per_page, $wpdb, $paged;
    if(empty($prelabel)) {
        $prelabel  = '<strong>&laquo;</strong>';
    }
    if(empty($nxtlabel)) {
        $nxtlabel = '<strong>&raquo;</strong>';
    }
    $half_pages_to_show = round($pages_to_show/2);
    if (!is_single()) {
        if(!is_category()) {
            preg_match('#FROM\s(.*)\sORDER BY#siU', $request, $matches);
        } else {
            preg_match('#FROM\s(.*)\sGROUP BY#siU', $request, $matches);
        }
        $fromwhere = $matches[1];
        $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");
        $max_page = ceil($numposts /$posts_per_page);
        if(empty($paged)) {
            $paged = 1;
        }
        if($max_page > 1 || $always_show) {
            echo "$before <div class=\"wp-pagenavi\"><span class=\"pages\">Page $paged of $max_page:</span>";
            if ($paged >= ($pages_to_show-1)) {
                echo '<a href="'.get_pagenum_link().'">&laquo; First</a>';
            }
            previous_posts_link($prelabel);
            for($i = $paged - $half_pages_to_show; $i  <= $paged + $half_pages_to_show; $i++) {
                if ($i >= 1 && $i <= $max_page) {
                    if($i == $paged) {
                        echo "<strong class='current'>$i</strong>";
                    } else {
                        echo ' <a href="'.get_pagenum_link($i).'">'.$i.'</a> ';
                    }
                }
            }
            next_posts_link($nxtlabel, $max_page);
            if (($paged+$half_pages_to_show) < ($max_page)) {
                echo '<a href="'.get_pagenum_link($max_page).'">Last &raquo;</a>';
            }
            echo "</div> $after";
        }
    }
}


<?php if (function_exists('custom_wp_pagenavi')) : ?>
<?php custom_wp_pagenavi(); ?>

如果您有任何建议,我们将不胜感激。

99%的可能性这是css问题。您可能是对的,我们将研究该选项