Kratos Theme Configuration Document

This document provides a comprehensive guide to the Kratos theme settings. It outlines each configuration tab, the purpose of every field, and where these changes take effect within the theme.


1. Site Configuration (站点配置)

This tab governs the foundational settings and global appearance of your website.

Field NameIDTypePurpose & FunctionImplementation DetailsSuggestions
Site Iconsite_icoUploadSets the favicon (browser tab icon).Applied in header.php via <link rel="icon">.Use a 32x32px or 64x64px PNG/ICO.
Gravatar Servergravatar_urlTextSets a custom Gravatar mirror.Used in inc/avatars.php to replace standard Gravatar URLs.Useful for users in China where Gravatar is often slow.
PJAXpage_pjaxCheckboxEnables fast page loading without full refreshes.Loads static/js/pjax.js and handles AJAX page swaps.Enable if using the background music player to prevent audio gaps.
SitemapsitemapCheckboxGenerates XML and HTML sitemaps for SEO.Triggers kratos_sitemap_refresh() on post publish/edit.Requires write permissions for the WordPress root directory.
Background Typebackground_modeSelectChoose the site's background style.Swaps between CSS color/image logic in header.php.'Image' provides a more immersive Anime-style look.
Background Colorbackground_index_colorColorSite background color for 'Pure Color' mode.Applied via inline style on #kratos-blog-post.Use a subtle color like #f5f5f5.
Background Imagebackground_index_imageUploadSite background image for 'Image' mode.Applied as a fixed background on .theme-bg.Use a high-quality 1920x1080px image.
Mobile BackgroundopenphoneimgCheckboxToggle a separate mobile background.Activates a @media query in header.php.Keep disabled unless you have a portrait-specific image.
Mobile Background Imagephone_imgUploadBackground image for mobile devices.Applied on mobile screens when openphoneimg is active.Use a vertical/portrait image for best fit.
Homepage Layouthome_side_barImagesChoose the sidebar position for the home.Changes grid classes in index.php.'Right Sidebar' is the most common for blogs.
Post List Layoutlist_layoutImagesChoose the style of the post archive.Influences inc/content-templates/content.php.'New Layout' uses large images and a modern card style.
Excerpt Lengthw_numTextNumber of characters in post summaries.Used by showSummary() in inc/myfunction.php.110 is standard for Chinese; use 40-60 for English.
Category/Tag Infoshow_head_cat/tagCheckboxShow titles at top of archive pages.Injected into index.php archive headers.Good for UX; helps users know where they are.
Local Avatarlo_avaCheckboxLet users upload avatars to your server.Adds an upload field to the User Profile page.Disable if you want to save server disk space.
Gutenberguse_gutenbergCheckboxToggle the new Block Editor.If disabled, removes block styles and forces Classic Editor.Enable if you prefer the modern block-based writing.
Sticky Sidebarsite_saCheckboxFixes sidebar position during scroll.Managed by sidebaraffix in static/js/kratos.js.Highly recommended for long pages to keep widgets visible.
Comment UAcomment_uaCheckboxDisplay commenter's browser/OS.Injected into comments via inc/ua.php.Adds a techy feel to the comment section.
Copy Noticecopy_noticeCheckboxAlert on text copy.Handled by a listener in static/js/kratos.js.Can be annoying; use only if content protection is vital.
Page Pseudo-staticpage_htmlCheckboxAdds .html to Page URLs.Modifies rewrite rules in inc/core.php.Optional; purely for URL aesthetics.

2. Component Configuration (组件配置)

Manage external resources and custom code snippets.

Field NameIDPurpose & FunctionImplementation
Custom Font Awesomefa_urlUse a specific CDN for icons.Replaces local FA link in inc/core.php.
Custom jQueryjq_urlUse a specific CDN for jQuery.Replaces local jQuery link in inc/core.php.
Additional JSadd_scriptInject custom JavaScript into footer.Printed at the bottom of footer.phpCaution: Don't include <script> tags.
Additional CSSadd_cssInject custom CSS into header.Printed in the <style> block in header.php.
Featured Imagedefault_imageFallback image for post lists.Used when a post has no featured image in 'New Layout'.
WeChat Buttoncd_weixinShow/Hide WeChat QR toggle.Injected into the floating tool menu in footer.php.
QR Codesweixin_imagealipayqr_urlwechatpayqr_urlAssets for social/donations.Displayed in modals/pop-ups when clicking Donate/WeChat.

3. SEO Configuration (SEO配置)

Basic SEO metadata for the homepage.

  • Keywords (site_keywords): Meta keywords for the index page. Used in header.php.
  • Description (site_description): Meta description for search engines. Used in header.php.
  • Statistics (script_tongji): Analytics code (Baidu/Google). Injected in footer.phpNote: Script tags are added automatically by the theme.

4. Header Configuration (顶部配置)

Customize the navigation area and the hero banner.

  • Display Mode (head_mode): Switch between a full-width Image (pic) banner or a simple Pure Color (color) nav bar.
  • Header Image (background_image): Background for the hero section in 'Image' mode.
  • Header Text (background_image_text1/2): Main title and subtitle displayed over the hero image.
  • Mobile Menu (mobi_mode): Choose if the mobile menu appears at the 'Top' or slides in from the 'Side'.
  • Nav Color (banner_color): Background color of the nav bar in RGBA (default: 22,23,26,.9).
  • Logo Image (banner_logo): Replaces site name with an image logo (Max 40px height).

5. Footer Configuration (底部配置)

Site info and social media presence.

  • Creation Time (createtime): Format MM/DD/YYYY hh:mm:ss. Used for the "Running time" counter in footer.php.
  • Social IDs: Links to GitHub, Weibo, Twitter, Bilibili, etc. Displayed as icons in the footer.
  • Registration Info: ICP (icp_num) and Public Security (gov_num) IDs for legal compliance in China.

6. Article & Page Settings (文章/页面设置)

Layout and feature toggles for individual posts and static pages.

  • Layout (side_bar / page_side_bar): Choose sidebar position (Left, Center, Right) independently.
  • Copyright (post_cc/page_cc): Toggles the "CC BY-SA 4.0" license box below content.
  • Share/Donate: Toggles social sharing buttons and the donation modal.

7. Carousel Settings (轮播设置)

Manage the homepage slideshow.

  • Switch (kratos_banner): Must be enabled for the carousel to appear.
  • Slides (1-5): Upload images (750px+ width recommended) and optional destination URLs.
  • Function: Implemented in inc/imgcfg.php using Bootstrap Carousel. Clears cache on save.

8. Email Settings (邮件设置)

Configure SMTP for outgoing system emails.

  • Function: Custom SMTP implementation in inc/smtp.php. Ensures emails (notifications, registration) are delivered reliably.
  • Secure Setting: Use ssl for standard encrypted SMTP or STARTTLS for Office 365.

9. Snowflake Settings (雪花设置)

Adds a visual "falling snow" effect to the background.

  • Interactivity: You can control the count, size, speed, and "repulsion" distance from the mouse pointer (snow_xb2016_mindist).
  • Implementation: Canvas-based animation in static/js/kratos.js.
  • Suggestion: Keep flake count around 150 to maintain performance.

10. Registration & Login (注册登录设置)

Hardens and brands the WordPress login experience.

  • Branding: Custom background (login_bak) and logo (login_logo) for the login page via inc/logincfg.php.
  • Security:
    • Login Limit: Brute-force protection. Locks IPs after allowed_retries failures.
    • Email Restrictions: Whitelist or Blacklist specific email domains for registration.

11. Other Settings (其他设置)

Toggles for functional extensions and interactive features.

  • Plugins: Enable/Disable bundled QPlayer (Music), TinyMCE (Editor), and Enlighter (Code Highlight).
  • Live2D:
    • Toggle (openlive2d): Show the animated "Waifu" character.
    • Position (wifuside): CSS-like positioning (e.g., left:30).
    • Side Switch (wifuchange): If enabled, flips the Live2D character to the opposite side on post pages.
  • Interactivity:
    • Entrance Animation (animal_load): Enables WOW.js/Animate.css effects as elements enter the viewport.
    • Tab Title: Changes browser tab title when user leaves (title_change) and returns (title_back).
    • Click Content: Comma-separated quoted strings (e.g., "Wow", "Cool") that pop up on mouse clicks.
  • Bilibili Integration:
    • bilibili_uid: Used in Bibo layout to show follower/play stats.
    • bilibili_cookie: Required for fetching advanced Bilibili data.
  • Homepage Filter (filter): Use category IDs with minus signs to exclude (e.g., -1,-5).

12. Bibo Layout Settings (B博界面设置)

A specialized layout mode mimicking Bilibili's "Dynamic" (Bibo) wall.

  • Bibo Open: Toggles the overall style switch button in the footer.
  • Direct Jump (bibo_gotobibo): Automatically defaults the homepage to the Bibo layout if a link is provided.
  • Implementation: Managed via a goto_bibo cookie and template logic in index.php and header.php.

Leave a Reply

Nickname and UID are optional, but email is required (you will receive an email after someone replies to your message).
tips: Enter UID to quickly get your nickname and avatar.

Title - Artist
0:00