`. That is deliberate: the AumCreate theme styles `.nav-links` (25 declarations * built on its own colour tokens, with contrast measured per ground), and keeping the class names identical * means the move needs no CSS change at all and a taken-over page still matches a theme-rendered one. * Renaming anything here silently unstyles pagination on every existing site. * * On a site running some other theme this comes out unstyled — the same as the rest of a taken-over page * today. Default styling for the moved shortcodes is a separate piece of work, done once for all of them. */ final class Pagination { public static function boot(): void { add_shortcode('aumframe_pagination', [self::class, 'render']); } public static function render($atts = []): string { global $wp_query; /* * It has to read the main query's `max_num_pages`. * * A loop in the layout may be its own WP_Query (`postType: 'post'` and the like), and those have * nothing to do with the `/page/2/` in the address bar — computing pagination from them produces a * bar that does nothing when clicked. An archive's loop should be using `source:'main'` in the first * place. */ $total = ($wp_query instanceof \WP_Query) ? (int) $wp_query->max_num_pages : 0; if ($total < 2) { return ''; } $a = shortcode_atts([ 'prev' => __('Previous', 'aumframe'), 'next' => __('Next', 'aumframe'), 'mid' => 2, 'class' => '', ], is_array($atts) ? $atts : []); $current = max(1, (int) (get_query_var('paged') ?: get_query_var('page') ?: 1)); $links = paginate_links([ 'total' => $total, 'current' => $current, 'mid_size' => max(0, (int) $a['mid']), 'prev_text' => esc_html((string) $a['prev']), 'next_text' => esc_html((string) $a['next']), 'type' => 'plain', ]); if (!$links) { return ''; } $cls = trim('aum-pagination ' . $a['class']); return \Aumframe\Chrome::style('aumframe_pagination') . ''; } }