diff --git a/comments.php b/comments.php index 6a1c774..ecce136 100644 --- a/comments.php +++ b/comments.php @@ -40,16 +40,39 @@ if (post_password_required()) return; '笺下留言', - 'title_reply_before' => '

', - 'title_reply_after' => '

', - 'comment_notes_before' => '', - 'comment_field' => '', - 'submit_button' => '', - 'submit_field' => '
%1$s %2$s
', - 'label_submit' => '落笔留痕', - )); + if (is_user_logged_in()) : + // 登录后:只显示留言框 + 按钮,隐藏 "Logged in as XXX" + comment_form(array( + 'title_reply' => '笺下留言', + 'title_reply_before' => '

', + 'title_reply_after' => '

', + 'comment_notes_before' => '', + 'comment_notes_after' => '', + 'logged_in_as' => '', + 'fields' => array(), + 'comment_field' => '', + 'submit_button' => '', + 'submit_field' => '
%1$s %2$s
', + 'label_submit' => '落笔留痕', + )); + else : + // 未登录:只显示输入框 + 按钮,提交时提示登录 ?> +

笺下留言

+
+ +
+ +
+
+ + diff --git a/functions.php b/functions.php index 104c339..66e0175 100644 --- a/functions.php +++ b/functions.php @@ -122,6 +122,9 @@ remove_action('admin_print_styles', 'print_emoji_styles'); add_filter('emoji_svg_url', '__return_false'); +// 隐藏顶部 admin bar +add_filter('show_admin_bar', '__return_false'); + // 评论表单中文化 add_filter('comment_form_default_fields', function($fields) { $fields['author'] = '

'; @@ -131,6 +134,9 @@ add_filter('comment_form_default_fields', function($fields) { return $fields; }); +// 评论无需审核直接发布 +add_filter('pre_comment_approved', function() { return 1; }); + add_action('template_include', function($template) { if (get_query_var('post_type') === 'post' && !is_home() && !is_singular()) { $t = locate_template('archive.php'); diff --git a/header.php b/header.php index 25462f7..c655004 100644 --- a/header.php +++ b/header.php @@ -15,24 +15,57 @@ -
- 'primary', - 'container' => false, - 'menu_class' => 'nav-links', - 'depth' => 1, - )); - } else { - echo '
    '; - echo '
  • 首页
  • '; - echo '
  • 笺文
  • '; - echo '
  • 微言
  • '; - echo '
  • 拾影
  • '; - echo '
'; - } +
+
+ 'primary', + 'container' => false, + 'menu_class' => 'nav-links', + 'depth' => 1, + )); + } else { + echo '
    '; + echo '
  • 首页
  • '; + echo '
  • 笺文
  • '; + echo '
  • 微言
  • '; + echo '
  • 拾影
  • '; + echo '
'; + } + ?> +
+ -
+
+ +
+ 个人资料 + 系统后台 + 退出 +
+
+ + +