/** * SprinGO archive router. * Critical fix: if a /category/... URL is still being forced into the old magazine archive, * route it to the compact TVPL category layout instead. */ if (!defined('ABSPATH')) exit; if (!function_exists('spr_force_tvpl_category_path')) { function spr_force_tvpl_category_path() { if (is_admin() || wp_doing_ajax() || is_feed() || is_preview() || is_customize_preview()) { return false; } $uri = isset($_SERVER['REQUEST_URI']) ? (string) wp_unslash($_SERVER['REQUEST_URI']) : ''; $path = trim((string) wp_parse_url($uri, PHP_URL_PATH), '/'); if (function_exists('spr_cat_tvpl_detect_category_path_v20') && spr_cat_tvpl_detect_category_path_v20()) { return true; } if ($path === 'category' || strpos($path, 'category/') === 0) { return true; } return is_category(); } } if (spr_force_tvpl_category_path()) { echo "\n\n"; $category_template = get_stylesheet_directory() . '/category-tvpl.php'; if (is_readable($category_template)) { require $category_template; return; } } $original = get_stylesheet_directory() . '/archive-springo-magazine-original.php'; if (is_readable($original)) { require $original; return; } // Fallback: keep site alive if the original archive file is missing. get_header(); echo '

' . esc_html(get_the_archive_title()) . '

'; if (have_posts()) { echo ''; } else { echo '

Chưa có bài viết.

'; } echo '
'; get_footer();