, once only (removed from header.php). aksrt_homepage_render_widget_zone( ['home_top_fluid'], 'fluid-widget-wrap aksrt-homepage__fluid-zone aksrt-homepage__fluid-zone--top' ); ?>
> $tab_configs Configured term tabs. */ function aksrt_homepage_get_tab_header_html(array $tab_configs): string { $list_title = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::home_list_title() : ''; $fallback_title = $list_title !== '' ? $list_title : __('最新发布', 'aksrt'); $paged = aksrt_homepage_get_current_page(); //不是第一页 if ($paged > 1) { return '
' . $fallback_title . '' . esc_html(sprintf(__('第%s页', 'aksrt'), $paged)) . '
'; } $index_tab_nav = ''; foreach ($tab_configs as $index => $tab_cfg) { $index_tab_nav .= '
  • ' . wp_kses_post($tab_cfg['title']) . '
  • '; } if (!$index_tab_nav) { return $list_title !== '' ? '
    ' . wp_kses_post($list_title) . '
    ' : '
    '; } $html = '
  • ' . wp_kses_post($fallback_title) . '
  • ' . $index_tab_nav; return '
      ' . $html . '
    '; } } if (!function_exists('aksrt_homepage_get_tab_panes_html')) { /** * legacy zib_index_tab('content'):每个栏目的原位刷新 pane。 * * pane 本身就是 .ajaxpager;post_ajax_trigger 指向栏目页,post_ajax 加载后 * 用栏目页自身的列表 DOM 原地替换 loader,不新建区域。 * * @param array> $tab_configs Configured term tabs. */ function aksrt_homepage_get_tab_panes_html(array $tab_configs): string { if (!$tab_configs) { return ''; } $is_card = class_exists('\AKSRT\Settings\PostDisplay') && \AKSRT\Settings\PostDisplay::get_archive_layout() === 'card'; $is_mobel = wp_is_mobile(); if ($is_card) { $placeholder_type = 'card'; $placeholder_num = $is_mobel ? 4 : 12; } else { $placeholder_type = 'list'; $placeholder_num = $is_mobel ? 4 : 6; } $placeholder = aksrt_render_placeholder($placeholder_type, $placeholder_num); $html = ''; foreach ($tab_configs as $index => $tab_cfg) { $html .= '
    '; $html .= ''; $html .= '
    ' . $placeholder . '
    '; $html .= '
    '; } return $html; } } if (!function_exists('aksrt_homepage_get_tab_link')) { /** * 栏目 tab 的加载链接:栏目页 + nofilter(抑制响应页的筛选菜单)。 * * @param array $tab_cfg Tab config with term and orderby. */ function aksrt_homepage_get_tab_link(array $tab_cfg): string { $term = $tab_cfg['term'] ?? null; if (!$term instanceof WP_Term) { return home_url('/'); } $query_arg = ['nofilter' => 'true']; if (!empty($tab_cfg['orderby'])) { $query_arg['orderby'] = $tab_cfg['orderby']; } $link = get_term_link($term); if (is_wp_error($link)) { return home_url('/'); } return add_query_arg($query_arg, $link); } } if (!function_exists('aksrt_render_fixed_homepage')) { /** * Render the new fixed homepage layout. */ function aksrt_render_fixed_homepage(): bool { if (!aksrt_is_fixed_homepage_request()) { return false; } get_header(); aksrt_homepage_render_layout(); get_footer(); return true; } }