Files
wordpress-kratos-yang/functions.php
T

69 lines
2.5 KiB
PHP
Raw Normal View History

2022-01-07 11:15:42 +08:00
<?php
/**
* 模板函数
* @author Yongquan Yang <yangyq.net>
2022-01-07 11:15:42 +08:00
* @license MIT License
* @version 2020.03.17
*/
define('THEME_VERSION', wp_get_theme()->get('Version'));
// 主题配置
require get_template_directory() . '/inc/options-framework/autoload.php';
// 自定义代码(CSS / JS,存选项表而非主题目录)
require get_template_directory() . '/inc/theme-custom-code.php';
2022-01-07 11:15:42 +08:00
// 更新配置
require get_template_directory() . '/inc/update-checker/autoload.php';
// 核心配置
require get_template_directory() . '/inc/theme-core.php';
// 图片类选项的默认值(Logo/favicon/404/分享图… 空值时落到包内默认图)。
// 必须排在 theme-core.php 之后:它要用 ASSET_PATH 与 kratos_option。
require get_template_directory() . '/inc/theme-option-defaults.php';
2022-01-07 11:15:42 +08:00
// 站点配置
require get_template_directory() . '/inc/theme-setting.php';
// 纪念日自动哀悼(按日期判断,需在 theme-setting 之后,
// 因为它用到 kratos_option)
require get_template_directory() . '/inc/theme-mourning.php';
// 哀悼说明页(固定路径 /memory,由主题判定路由,不写数据库)
require get_template_directory() . '/inc/theme-mourning-page.php';
2022-01-07 11:15:42 +08:00
// 文章配置
require get_template_directory() . '/inc/theme-article.php';
// 评论区(统一渲染 + AJAX + 评论通知)。
// 必须在 theme-article.php 之后:后者不再定义评论函数,
// 但评论模板 comments.php 里引用的 comment_callbacks 由本文件提供。
// 也必须早于 theme-mail.php(评论通知要调 yang_mail_render)。
require get_template_directory() . '/inc/theme-comments.php';
2022-01-07 11:15:42 +08:00
// 小工具配置
require get_template_directory() . '/inc/theme-widgets.php';
// 文章增强
require get_template_directory() . '/inc/theme-shortcode.php';
// 文章目录([TOC] 短代码)
require get_template_directory() . '/inc/theme-toc.php';
2022-01-07 11:15:42 +08:00
// 添加导航目录
require get_template_directory() . '/inc/theme-navwalker.php';
// 对象存储配置
require get_template_directory() . '/inc/theme-dogecloud.php';
// 邮件模板:必须先于 theme-mail.php 加载,
// 因为后者在发信时会调用 yang_mail_render()
require get_template_directory() . '/inc/theme-mail-template.php';
// 邮件治理:统一接管发信通道、去重、关掉重复通知
require get_template_directory() . '/inc/theme-mail.php';
// SMTP 配置(连通性相关,实际接管在 theme-mail.php)
require get_template_directory() . '/inc/theme-smtp.php';