diff --git a/footer.php b/footer.php index bd88cba..28025d2 100644 --- a/footer.php +++ b/footer.php @@ -1,8 +1,8 @@ diff --git a/functions.php b/functions.php index 9a683e1..e47e916 100644 --- a/functions.php +++ b/functions.php @@ -282,6 +282,95 @@ add_filter('comment_form_defaults', function($defaults) { return $defaults; }); +// ── Customizer(外观 → 自定义 → 空笺未寄设置) ──── +add_action('customize_register', 'kjweji_customize_register'); +function kjweji_customize_register($wp_customize) { + // 注册 section + $wp_customize->add_section('kjweji_settings', array( + 'title' => '空笺未寄设置', + 'priority' => 30, + )); + // ── 首页 ── + $wp_customize->add_setting('kjweji_hero_intro', array( + 'default' => "这里是自白者的栖息地。\n吐槽,落笔,沉思,接住那一缕若有的情绪。\n片语只言,皆是存在。", + 'sanitize_callback' => 'sanitize_textarea_field', + )); + $wp_customize->add_control('kjweji_hero_intro', array( + 'label' => '首页介绍文字', + 'section' => 'kjweji_settings', + 'type' => 'textarea', + )); + $wp_customize->add_setting('kjweji_hero_couplet', array( + 'default' => '空笺待写千般意,未寄先存一寸心', + 'sanitize_callback' => 'sanitize_text_field', + )); + $wp_customize->add_control('kjweji_hero_couplet', array( + 'label' => '首页对联', + 'section' => 'kjweji_settings', + 'type' => 'text', + )); + $wp_customize->add_setting('kjweji_hero_couplet_hl1', array( + 'default' => '千般意', + 'sanitize_callback' => 'sanitize_text_field', + )); + $wp_customize->add_control('kjweji_hero_couplet_hl1', array( + 'label' => '对联高亮词1', + 'section' => 'kjweji_settings', + 'type' => 'text', + )); + + $wp_customize->add_setting('kjweji_hero_couplet_hl2', array( + 'default' => '一寸心', + 'sanitize_callback' => 'sanitize_text_field', + )); + $wp_customize->add_control('kjweji_hero_couplet_hl2', array( + 'label' => '对联高亮词2', + 'section' => 'kjweji_settings', + 'type' => 'text', + )); + + // ── 页脚 ── + $wp_customize->add_setting('kjweji_footer_motto', array( + 'default' => '空笺待写千般意,未寄先存一寸心', + 'sanitize_callback' => 'sanitize_text_field', + )); + $wp_customize->add_control('kjweji_footer_motto', array( + 'label' => '页脚格言', + 'section' => 'kjweji_settings', + 'type' => 'text', + )); + + $wp_customize->add_setting('kjweji_footer_text', array( + 'default' => '每一段文字,都在时光里等待回音', + 'sanitize_callback' => 'sanitize_text_field', + )); + $wp_customize->add_control('kjweji_footer_text', array( + 'label' => '页脚版权文案', + 'section' => 'kjweji_settings', + 'type' => 'text', + )); + + // ── 页面副标题 ── + $wp_customize->add_setting('kjweji_articles_subtitle', array( + 'default' => '字里行间,尽是岁月', + 'sanitize_callback' => 'sanitize_text_field', + )); + $wp_customize->add_control('kjweji_articles_subtitle', array( + 'label' => '笺文页副标题', + 'section' => 'kjweji_settings', + 'type' => 'text', + )); + + $wp_customize->add_setting('kjweji_photos_subtitle', array( + 'default' => '在时光里截图', + 'sanitize_callback' => 'sanitize_text_field', + )); + $wp_customize->add_control('kjweji_photos_subtitle', array( + 'label' => '拾影页副标题', + 'section' => 'kjweji_settings', + 'type' => 'text', + )); +} diff --git a/index.php b/index.php index dbe242b..a02fbe6 100644 --- a/index.php +++ b/index.php @@ -4,11 +4,16 @@

-

空笺待写千般意,未寄先存一寸心

+ ' . $hl1 . '', $couplet); + $couplet = str_replace($hl2, '' . $hl2 . '', $couplet); + ?> +

- 这里是自白者的栖息地。
- 吐槽,落笔,沉思,接住那一缕若有的情绪。
- 片语只言,皆是存在。 +

diff --git a/page-articles.php b/page-articles.php index 120704a..e96d8aa 100644 --- a/page-articles.php +++ b/page-articles.php @@ -17,7 +17,7 @@ $total_pages = ceil($total / $per_page);
📜 笺文 - 字里行间,尽是岁月 +
have_posts()) : ?> diff --git a/page-photos.php b/page-photos.php index 526bdf4..bcacb17 100644 --- a/page-photos.php +++ b/page-photos.php @@ -14,7 +14,7 @@ $photo_query = new WP_Query(array(
📷 拾影 - 在时光里截图 +
have_posts()) : ?>