feat: Argon WordPress主题完整版本

- 基于Argon主题的WordPress博客主题
- 支持响应式设计和暗色模式
- 包含完整的文章管理和评论系统
- 集成友情链接管理功能
- 支持多种自定义设置选项
- 优化的用户界面和交互体验
This commit is contained in:
2026-01-11 19:48:02 +08:00
commit 31d8fde308
547 changed files with 147669 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
<article class="no-results post card bg-white shadow-sm border-0">
<header class="post-header text-center">
<i style="font-size:80px;opacity:.6;margin-top:30px;margin-bottom:15px;" aria-hidden="true" class="fa fa-folder-o"></i>
<h1 class="post-title"><?php _e('没有搜索结果', 'argon');?></h1>
<?php if (($_GET['post_type'] ?? '') == 'none'){ ?>
<span><?php _e('似乎没有勾选任何分类', 'argon');?></span>
<?php } else { ?>
<span><?php _e('换个关键词试试 ?', 'argon');?></span>
<?php }?>
<br>
<a href="javascript:window.history.back(-1);" ondragstart="return false;" class="btn btn-outline-primary" style="margin-top:45px;">
<span class="btn-inner--icon"><i class="fa fa-chevron-left"></i></span>
<span class="btn-inner--text"><?php _e('返回上一页', 'argon');?></span>
</a>
</header>
</article>

View File

@@ -0,0 +1,12 @@
<article class="no-results post card bg-white shadow-sm border-0">
<header class="post-header text-center">
<i style="font-size:80px;opacity:.6;margin-top:30px;margin-bottom:15px;" aria-hidden="true" class="fa fa-folder-o"></i>
<h1 class="post-title"><?php _e('此分类没有文章', 'argon');?></h1>
<span><?php _e('这里什么都没有', 'argon');?></span>
<br>
<a href="javascript:window.history.back(-1);" ondragstart="return false;" class="btn btn-outline-primary" style="margin-top:45px;">
<span class="btn-inner--icon"><i class="fa fa-chevron-left"></i></span>
<span class="btn-inner--text"><?php _e('返回上一页', 'argon');?></span>
</a>
</header>
</article>

View File

@@ -0,0 +1,110 @@
<article class="post post-full card bg-white shadow-sm border-0" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="post-header text-center<?php if (argon_has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){echo " post-header-with-thumbnail";}?>">
<?php
if (argon_has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){
$thumbnail_url = argon_get_post_thumbnail();
echo "<img class='post-thumbnail' src='" . $thumbnail_url . "'></img>";
echo "<div class='post-header-text-container'>";
}
if (argon_has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') == 'true'){
$thumbnail_url = argon_get_post_thumbnail();
echo "
<style>
body section.banner {
background-image: url(" . $thumbnail_url . ") !important;
}
</style>";
}
?>
<a class="post-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<div class="post-meta">
<?php
$metaList = explode('|', get_option('argon_article_meta', 'time|views|comments|categories'));
if (is_sticky() && is_home() && ! is_paged()){
array_unshift($metaList, "sticky");
}
if (post_password_required()){
array_unshift($metaList, "needpassword");
}
if (is_meta_simple()){
array_remove($metaList, "time");
array_remove($metaList, "edittime");
array_remove($metaList, "categories");
array_remove($metaList, "author");
}
if (count(get_the_category()) == 0){
array_remove($metaList, "categories");
}
for ($i = 0; $i < count($metaList); $i++){
if ($i > 0){
echo ' <div class="post-meta-devide">|</div> ';
}
echo get_article_meta($metaList[$i]);
}
?>
<?php if (!post_password_required() && get_option("argon_show_readingtime") != "false" && is_readingtime_meta_hidden() == False) {
echo get_article_reading_time_meta(get_the_content());
} ?>
</div>
<?php
if (has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){
echo "</div>";
}
?>
</header>
<div class="post-content" id="post_content">
<?php if (post_password_required()){ ?>
<div class="text-center container">
<form action="<?php echo $GLOBALS['wp_path']; ?>wp-login.php?action=postpass" class="post-password-form" method="post">
<div class="post-password-form-text"><?php _e('这是一篇受密码保护的文章,您需要提供访问密码', 'argon');?></div>
<div class="row">
<div class="form-group col-lg-6 col-md-8 col-sm-10 col-xs-12 post-password-form-input">
<div class="input-group input-group-alternative">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-key"></i></span>
</div>
<input name="post_password" class="form-control" placeholder="<?php _e('密码', 'argon');?>" type="password">
</div>
<?php
$post_password_hint = get_post_meta(get_the_ID(), 'password_hint', true);
if (!empty($post_password_hint)){
echo '<div class="post-password-hint">' . $post_password_hint . '</div>';
}
?>
</div>
</div>
<input class="btn btn-primary" type="submit" name="Submit" value="<?php _e('确认', 'argon');?>">
</form>
</div>
<?php
}else{
global $post_references, $post_reference_keys_first_index, $post_reference_contents_first_index;
$post_references = array();
$post_reference_keys_first_index = array();
$post_reference_contents_first_index = array();
the_content();
}
?>
</div>
<?php
$referenceList = get_reference_list();
if ($referenceList != ""){
echo $referenceList;
}
?>
<?php if (has_tag()) { ?>
<div class="post-tags">
<i class="fa fa-tags" aria-hidden="true"></i>
<?php
$tags = get_the_tags();
foreach ($tags as $tag) {
echo "<a href='" . get_category_link($tag -> term_id) . "' target='_blank' class='tag badge badge-secondary post-meta-detail-tag'>" . $tag -> name . "</a>";
}
?>
</div>
<?php } ?>
</article>

View File

@@ -0,0 +1,174 @@
<article class="post card bg-white shadow-sm border-0 <?php if (get_option('argon_enable_into_article_animation') == 'true'){echo 'post-preview';} ?>" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="post-header text-center<?php if (argon_has_post_thumbnail()){echo " post-header-with-thumbnail";}?>">
<?php
if (argon_has_post_thumbnail()){
$thumbnail_url = argon_get_post_thumbnail();
if (get_option('argon_enable_lazyload') != 'false'){
echo "<img class='post-thumbnail lazyload' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABBJREFUeNpi+P//PwNAgAEACPwC/tuiTRYAAAAASUVORK5CYII=' data-original='" . $thumbnail_url . "' alt='thumbnail' style='opacity: 0;'></img>";
}else{
echo "<img class='post-thumbnail' src='" . $thumbnail_url . "'></img>";
}
echo "<div class='post-header-text-container'>";
}
?>
<a class="post-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<div class="post-meta">
<?php
$metaList = explode('|', get_option('argon_article_meta', 'time|views|comments|categories'));
if (is_sticky() && is_home() && ! is_paged()){
array_unshift($metaList, "sticky");
}
if (post_password_required()){
array_unshift($metaList, "needpassword");
}
for ($i = 0; $i < count($metaList); $i++){
if ($i > 0){
echo ' <div class="post-meta-devide">|</div> ';
}
echo get_article_meta($metaList[$i]);
}
?>
<?php
global $post;
$post_content_full = apply_filters('the_content', preg_replace( '<!--more(.*?)-->', '', $post -> post_content));
$post_content_with_more = apply_filters('the_content', $post -> post_content);
?>
<?php if (!post_password_required() && get_option("argon_show_readingtime") != "false" && is_readingtime_meta_hidden() == False) {
echo get_article_reading_time_meta($post_content_full);
} ?>
</div>
<?php
if (argon_has_post_thumbnail()){
echo "</div>";
}
?>
</header>
<?php
$trim_words_count = get_option('argon_trim_words_count', 175);
?>
<?php if ($trim_words_count > 0){ ?>
<div class="post-content">
<?php
if (get_option("argon_hide_shortcode_in_preview") == 'true'){
$preview = wp_trim_words(do_shortcode(get_the_content('...')), $trim_words_count);
}else{
$preview = wp_trim_words(get_the_content('...'), $trim_words_count);
}
if (post_password_required()){
$preview = __("这篇文章受密码保护,输入密码才能阅读", 'argon');
}
if ($preview == ""){
$preview = __("这篇文章没有摘要", 'argon');
}
if ($post -> post_excerpt){
$preview = $post -> post_excerpt;
}
// 应用特殊样式处理(黑幕、彩幕等)
if (function_exists('argon_apply_comment_macros')) {
$preview = argon_apply_comment_macros($preview);
}
echo $preview;
?>
</div>
<?php
}
?>
<?php if (has_tag()) { ?>
<div class="post-tags">
<i class="fa fa-tags" aria-hidden="true"></i>
<?php
$tags = get_the_tags();
foreach ($tags as $tag) {
echo "<a href='" . get_category_link($tag -> term_id) . "' target='_blank' class='tag badge badge-secondary post-meta-detail-tag'>" . $tag -> name . "</a>";
}
?>
</div>
<?php } ?>
</article>

View File

@@ -0,0 +1,164 @@
<article class="post card bg-white shadow-sm border-0 <?php if (get_option('argon_enable_into_article_animation') == 'true'){echo 'post-preview';} ?> post-preview-layout-2" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="post-header <?php if (argon_has_post_thumbnail()){echo " post-header-with-thumbnail";}?>">
<?php
if (argon_has_post_thumbnail()){
$thumbnail_url = argon_get_post_thumbnail();
if (get_option('argon_enable_lazyload') != 'false'){
echo "<img class='post-thumbnail lazyload' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABBJREFUeNpi+P//PwNAgAEACPwC/tuiTRYAAAAASUVORK5CYII=' data-original='" . $thumbnail_url . "' alt='thumbnail' style='opacity: 0;'></img>";
}else{
echo "<img class='post-thumbnail' src='" . $thumbnail_url . "'></img>";
}
}
?>
</header>
<div class="post-content-container">
<a class="post-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php
$trim_words_count = get_option('argon_trim_words_count', 175);
?>
<?php if ($trim_words_count > 0){ ?>
<div class="post-content">
<?php
if (get_option("argon_hide_shortcode_in_preview") == 'true'){
$preview = wp_trim_words(do_shortcode(get_the_content('...')), $trim_words_count);
}else{
$preview = wp_trim_words(get_the_content('...'), $trim_words_count);
}
if (post_password_required()){
$preview = __("这篇文章受密码保护,输入密码才能阅读", 'argon');
}
if ($preview == ""){
$preview = __("这篇文章没有摘要", 'argon');
}
if ($post -> post_excerpt){
$preview = $post -> post_excerpt;
}
// 应用特殊样式处理(黑幕、彩幕等)
if (function_exists('argon_apply_comment_macros')) {
$preview = argon_apply_comment_macros($preview);
}
echo $preview;
?>
</div>
<?php
}
?>
<div class="post-meta">
<?php
$metaList = explode('|', get_option('argon_article_meta', 'time|views|comments|categories'));
if (is_sticky() && is_home() && ! is_paged()){
array_unshift($metaList, "sticky");
}
if (post_password_required()){
array_unshift($metaList, "needpassword");
}
for ($i = 0; $i < count($metaList); $i++){
if ($i > 0){
echo ' <div class="post-meta-devide">|</div> ';
}
echo get_article_meta($metaList[$i]);
}
?>
<?php
global $post;
$post_content_full = apply_filters('the_content', preg_replace( '<!--more(.*?)-->', '', $post -> post_content));
$post_content_with_more = apply_filters('the_content', $post -> post_content);
?>
<?php if (!post_password_required() && get_option("argon_show_readingtime") != "false" && is_readingtime_meta_hidden() == False) {
echo get_article_reading_time_meta($post_content_full);
} ?>
</div>
<?php if (has_tag()) { ?>
<div class="post-tags">
<i class="fa fa-tags" aria-hidden="true"></i>
<?php
$tags = get_the_tags();
foreach ($tags as $tag) {
echo "<a href='" . get_category_link($tag -> term_id) . "' target='_blank' class='tag badge badge-secondary post-meta-detail-tag'>" . $tag -> name . "</a>";
}
?>
</div>
<?php } ?>
</div>
</article>

View File

@@ -0,0 +1,166 @@
<article class="post card bg-white shadow-sm border-0 <?php if (get_option('argon_enable_into_article_animation') == 'true'){echo 'post-preview';} ?> post-preview-layout-3" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if (argon_has_post_thumbnail()){
echo "<header class='post-header post-header-with-thumbnail'>";
$thumbnail_url = argon_get_post_thumbnail();
if (get_option('argon_enable_lazyload') != 'false'){
echo "<img class='post-thumbnail lazyload' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABBJREFUeNpi+P//PwNAgAEACPwC/tuiTRYAAAAASUVORK5CYII=' data-original='" . $thumbnail_url . "' alt='thumbnail' style='opacity: 0;'></img>";
}else{
echo "<img class='post-thumbnail' src='" . $thumbnail_url . "'></img>";
}
echo "</header>";
}
?>
<header class="post-header">
<a class="post-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<div class="post-meta">
<?php
$metaList = explode('|', get_option('argon_article_meta', 'time|views|comments|categories'));
if (is_sticky() && is_home() && ! is_paged()){
array_unshift($metaList, "sticky");
}
if (post_password_required()){
array_unshift($metaList, "needpassword");
}
for ($i = 0; $i < count($metaList); $i++){
if ($i > 0){
echo ' <div class="post-meta-devide">|</div> ';
}
echo get_article_meta($metaList[$i]);
}
?>
<?php
global $post;
$post_content_full = apply_filters('the_content', preg_replace( '<!--more(.*?)-->', '', $post -> post_content));
$post_content_with_more = apply_filters('the_content', $post -> post_content);
?>
<?php if (!post_password_required() && get_option("argon_show_readingtime") != "false" && is_readingtime_meta_hidden() == False) {
echo get_article_reading_time_meta($post_content_full);
} ?>
</div>
</header>
<?php
$trim_words_count = get_option('argon_trim_words_count', 175);
?>
<?php if ($trim_words_count > 0){ ?>
<div class="post-content">
<?php
if (get_option("argon_hide_shortcode_in_preview") == 'true'){
$preview = wp_trim_words(do_shortcode(get_the_content('...')), $trim_words_count);
}else{
$preview = wp_trim_words(get_the_content('...'), $trim_words_count);
}
if (post_password_required()){
$preview = __("这篇文章受密码保护,输入密码才能阅读", 'argon');
}
if ($preview == ""){
$preview = __("这篇文章没有摘要", 'argon');
}
if ($post -> post_excerpt){
$preview = $post -> post_excerpt;
}
// 应用特殊样式处理(黑幕、彩幕等)
if (function_exists('argon_apply_comment_macros')) {
$preview = argon_apply_comment_macros($preview);
}
echo $preview;
?>
</div>
<?php
}
?>
<?php if (has_tag()) { ?>
<div class="post-tags">
<i class="fa fa-tags" aria-hidden="true"></i>
<?php
$tags = get_the_tags();
foreach ($tags as $tag) {
echo "<a href='" . get_category_link($tag -> term_id) . "' target='_blank' class='tag badge badge-secondary post-meta-detail-tag'>" . $tag -> name . "</a>";
}
?>
</div>
<?php } ?>
</article>

View File

@@ -0,0 +1,38 @@
<div class="shuoshuo-container">
<div class="shuoshuo-meta shadow-sm">
<span>
<i class="fa fa-calendar-o" aria-hidden="true"></i>
<span class="shuoshuo-date-month"><?php echo get_the_time('n')?></span> <?php _e('月', 'argon');?>
<span class="shuoshuo-date-date"><?php echo get_the_time('d')?></span> <?php _e('日', 'argon');?> ,
<span class="shuoshuo-date-year"><?php echo get_the_time('Y')?></span>
<div class="post-meta-devide">|</div>
<i class="fa fa-clock-o" aria-hidden="true"></i>
<span class="shuoshuo-date-time"><?php echo get_the_time('G:i:s')?></span>
</span>
<?php if ( is_sticky() ) : ?>
<div class="post-meta-devide">|</div>
<div class="post-meta-detail post-meta-detail-words">
<i class="fa fa-thumb-tack" aria-hidden="true"></i>
<?php _ex('置顶', 'pinned', 'argon');?>
</div>
<?php endif; ?>
</div>
<article class="card shuoshuo-main bg-white shadow-sm border-0" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( get_the_title() != '' ) : ?>
<a class="shuoshuo-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php endif; ?>
<div class="shuoshuo-content">
<?php the_content(); ?>
</div>
<?php
get_template_part( 'template-parts/shuoshuo', 'operations' );
?>
<style>
.shuoshuo-preview-add-comment-out-container-a{
display: none;
}
</style>
</article>
</div>

View File

@@ -0,0 +1,49 @@
<div class="shuoshuo-preview-container shuoshuo-foldable card bg-white shadow-sm border-0" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( get_the_title() != '' ) : ?>
<a class="shuoshuo-title"><?php the_title(); ?></a>
<?php endif; ?>
<div class="shuoshuo-content">
<?php the_content(); ?>
</div>
</article>
<div class="shuoshuo-preview-meta">
<span>
<i class="fa fa-calendar-o" aria-hidden="true"></i>
<span class="shuoshuo-date-month"><?php echo get_the_time('n')?></span> <?php _e('月', 'argon');?>
<span class="shuoshuo-date-date"><?php echo get_the_time('d')?></span> <?php _e('日', 'argon');?> ,
<span class="shuoshuo-date-year"><?php echo get_the_time('Y')?></span>
<div class="post-meta-devide">|</div>
<i class="fa fa-clock-o" aria-hidden="true"></i>
<span class="shuoshuo-date-time"><?php echo get_the_time('G:i')?></span>
</span>
<?php if ( is_sticky() ) : ?>
<div class="post-meta-devide">|</div>
<div class="post-meta-detail post-meta-detail-words">
<i class="fa fa-thumb-tack" aria-hidden="true"></i>
<?php _ex('置顶', 'pinned', 'argon');?>
</div>
<?php endif; ?>
<?php
$upvote_count = get_shuoshuo_upvotes(get_the_ID());
$comment_count = get_post(get_the_ID()) -> comment_count;
?>
<?php if ( $upvote_count > 0 ) : ?>
<div class="post-meta-devide">|</div>
<div class="post-meta-detail post-meta-detail-words">
<i class="fa fa-thumbs-o-up" aria-hidden="true"></i>
<?php echo $upvote_count; ?>
</div>
<?php endif; ?>
<?php if ( $comment_count > 0 ) : ?>
<div class="post-meta-devide">|</div>
<div class="post-meta-detail post-meta-detail-words">
<i class="fa fa-comments-o" aria-hidden="true"></i>
<?php echo $comment_count; ?>
</div>
<?php endif; ?>
</div>
<a class="shuoshuo-preview-link btn btn-outline-primary btn-icon-only rounded-circle" type="button" href="<?php the_permalink(); ?>">
<span class="btn-inner--icon"><i class="fa fa-arrow-right"></i></span>
</a>
</div>

View File

@@ -0,0 +1,37 @@
<div class="shuoshuo-container">
<div class="shuoshuo-meta shadow-sm">
<span>
<i class="fa fa-calendar-o" aria-hidden="true"></i>
<span class="shuoshuo-date-month"><?php echo get_the_time('n')?></span> <?php _e('月', 'argon');?>
<span class="shuoshuo-date-date"><?php echo get_the_time('d')?></span> <?php _e('日', 'argon');?> ,
<span class="shuoshuo-date-year"><?php echo get_the_time('Y')?></span>
<div class="post-meta-devide">|</div>
<i class="fa fa-clock-o" aria-hidden="true"></i>
<span class="shuoshuo-date-time"><?php echo get_the_time('G:i:s')?></span>
</span>
<?php if ( is_sticky() ) : ?>
<div class="post-meta-devide">|</div>
<div class="post-meta-detail post-meta-detail-words">
<i class="fa fa-thumb-tack" aria-hidden="true"></i>
<?php _ex('置顶', 'pinned', 'argon');?>
</div>
<?php endif; ?>
</div>
<article class="card shuoshuo-main shuoshuo-foldable bg-white shadow-sm border-0" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( get_the_title() != '' ) : ?>
<a class="shuoshuo-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php endif; ?>
<div class="shuoshuo-content">
<?php the_content(); ?>
</div>
<?php
global $withcomments;
$withcomments = true;
comments_template( '/comments-shuoshuo-preview.php' );
?>
<?php
get_template_part( 'template-parts/shuoshuo', 'operations' );
?>
</article>
</div>

View File

@@ -0,0 +1,125 @@
<article class="post post-full card bg-white shadow-sm border-0" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="post-header text-center<?php if (argon_has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){echo " post-header-with-thumbnail";}?>">
<?php
if (argon_has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){
$thumbnail_url = argon_get_post_thumbnail();
echo "<img class='post-thumbnail' src='" . $thumbnail_url . "'></img>";
echo "<div class='post-header-text-container'>";
}
if (argon_has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') == 'true'){
$thumbnail_url = argon_get_post_thumbnail();
echo "
<style>
body section.banner {
background-image: url(" . $thumbnail_url . ") !important;
}
</style>";
}
?>
<a class="post-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<div class="post-meta">
<?php
$metaList = explode('|', get_option('argon_article_meta', 'time|views|comments|categories'));
if (is_sticky() && is_home() && ! is_paged()){
array_unshift($metaList, "sticky");
}
if (post_password_required()){
array_unshift($metaList, "needpassword");
}
if (is_meta_simple()){
array_remove($metaList, "time");
array_remove($metaList, "edittime");
array_remove($metaList, "categories");
array_remove($metaList, "author");
}
for ($i = 0; $i < count($metaList); $i++){
if ($i > 0){
echo ' <div class="post-meta-devide">|</div> ';
}
echo get_article_meta($metaList[$i]);
}
?>
<?php if (!post_password_required() && get_option("argon_show_readingtime") != "false" && is_readingtime_meta_hidden() == False) {
echo get_article_reading_time_meta(get_the_content());
} ?>
</div>
<?php
if (has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){
echo "</div>";
}
?>
</header>
<div class="post-content" id="post_content">
<?php if (post_password_required()){ ?>
<div class="text-center container">
<form action="<?php echo $GLOBALS['wp_path']; ?>wp-login.php?action=postpass" class="post-password-form" method="post">
<div class="post-password-form-text"><?php _e('这是一篇受密码保护的文章,您需要提供访问密码', 'argon');?></div>
<div class="row">
<div class="form-group col-lg-6 col-md-8 col-sm-10 col-xs-12 post-password-form-input">
<div class="input-group input-group-alternative">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-key"></i></span>
</div>
<input name="post_password" class="form-control" placeholder="<?php _e('密码', 'argon');?>" type="password" value="<?php if (current_user_can('level_7')){global $post;if (isset($post -> post_password)){echo esc_attr($post->post_password);}} ?>">
</div>
<?php
$post_password_hint = get_post_meta(get_the_ID(), 'password_hint', true);
if (!empty($post_password_hint)){
echo '<div class="post-password-hint">' . $post_password_hint . '</div>';
}
?>
</div>
</div>
<input class="btn btn-primary" type="submit" name="Submit" value="<?php _e('确认', 'argon');?>">
</form>
</div>
<?php
}else{
echo argon_get_post_outdated_info();
global $post_references, $post_reference_keys_first_index, $post_reference_contents_first_index;
$post_references = array();
$post_reference_keys_first_index = array();
$post_reference_contents_first_index = array();
the_content();
}
?>
</div>
<?php
$referenceList = get_reference_list();
if ($referenceList != ""){
echo $referenceList;
}
?>
<?php if (get_option("argon_donate_qrcode_url") != '') { ?>
<div class="post-donate">
<button class="btn donate-btn btn-danger"><?php _e('赞赏', 'argon');?></button>
<div class="donate-qrcode card shadow-sm bg-white">
<img src="<?php echo get_option("argon_donate_qrcode_url"); ?>">
</div>
</div>
<?php } ?>
<?php
$additionalContentAfterPost = get_additional_content_after_post();
if ($additionalContentAfterPost != ""){
echo "<div class='additional-content-after-post'>" . $additionalContentAfterPost . "</div>";
}
?>
<?php if (has_tag()) { ?>
<div class="post-tags">
<i class="fa fa-tags" aria-hidden="true"></i>
<?php
$tags = get_the_tags();
foreach ($tags as $tag) {
echo "<a href='" . get_category_link($tag -> term_id) . "' target='_blank' class='tag badge badge-secondary post-meta-detail-tag'>" . $tag -> name . "</a>";
}
?>
</div>
<?php } ?>
</article>

View File

@@ -0,0 +1,123 @@
<article class="post post-full card bg-white shadow-sm border-0" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="post-header text-center<?php if (argon_has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){echo " post-header-with-thumbnail";}?>">
<?php
if (argon_has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){
$thumbnail_url = argon_get_post_thumbnail();
echo "<img class='post-thumbnail' src='" . $thumbnail_url . "'></img>";
echo "<div class='post-header-text-container'>";
}
if (argon_has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') == 'true'){
$thumbnail_url = argon_get_post_thumbnail();
echo "
<style>
body section.banner {
background-image: url(" . $thumbnail_url . ") !important;
}
</style>";
}
?>
<a class="post-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<div class="post-meta">
<?php
$metaList = explode('|', get_option('argon_article_meta', 'time|views|comments|categories'));
if (is_sticky() && is_home() && ! is_paged()){
array_unshift($metaList, "sticky");
}
if (post_password_required()){
array_unshift($metaList, "needpassword");
}
if (is_meta_simple()){
array_remove($metaList, "time");
array_remove($metaList, "edittime");
array_remove($metaList, "categories");
array_remove($metaList, "author");
}
if (count(get_the_category()) == 0){
array_remove($metaList, "categories");
}
for ($i = 0; $i < count($metaList); $i++){
if ($i > 0){
echo ' <div class="post-meta-devide">|</div> ';
}
echo get_article_meta($metaList[$i]);
}
?>
</div>
<?php
if (has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){
echo "</div>";
}
?>
</header>
<div class="post-content" id="post_content">
<?php if (post_password_required()){ ?>
<div class="text-center container">
<form action="/wp-login.php?action=postpass" class="post-password-form" method="post">
<div class="post-password-form-text"><?php _e('这是一篇受密码保护的文章,您需要提供访问密码', 'argon');?></div>
<div class="row">
<div class="form-group col-lg-6 col-md-8 col-sm-10 col-xs-12 post-password-form-input">
<div class="input-group input-group-alternative">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-key"></i></span>
</div>
<input name="post_password" class="form-control" placeholder="密码" type="password">
</div>
</div>
</div>
<input class="btn btn-primary" type="submit" name="Submit" value="确认">
</form>
</div>
<?php
}else{
$show_month = get_option('argon_archives_timeline_show_month', 'true');
$POST = $GLOBALS['post'];
echo "<div class='argon-timeline archive-timeline'>";
$last_year = 0;
$last_month = 0;
$posts = get_posts('numberposts=-1&orderby=post_date&order=DESC');
foreach ($posts as $post){
setup_postdata($post);
$year = mysql2date('Y', $post -> post_date);
$month = mysql2date('M', $post -> post_date);
if ($year != $last_year){
echo "<div class='argon-timeline-node'>
<h2 class='argon-timeline-time archive-timeline-year'><a href='" . get_year_link($year) . "'>" . $year . "</a></h2>
<div class='argon-timeline-card card bg-gradient-secondary archive-timeline-title'></div>
</div>";
$last_year = $year;
$last_month = 0;
}
if ($month != $last_month && $show_month == 'true'){
echo "<div class='argon-timeline-node'>
<h3 class='argon-timeline-time archive-timeline-month" . ($last_month == 0 ? " first-month-of-year" : "") . "'><a href='" . get_month_link($year, $month) . "'>" . $month . "</a></h3>
<div class='argon-timeline-card card bg-gradient-secondary archive-timeline-title'></div>
</div>";
$last_month = $month;
} ?>
<div class='argon-timeline-node'>
<div class='argon-timeline-time'><?php echo mysql2date('m-d', $post -> post_date); ?></div>
<div class='argon-timeline-card card bg-gradient-secondary archive-timeline-title'>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</div>
</div>
<?php
}
echo '</div>';
$GLOBALS['post'] = $POST;
}
?>
</div>
<?php if (has_tag()) { ?>
<div class="post-tags">
<i class="fa fa-tags" aria-hidden="true"></i>
<?php
$tags = get_the_tags();
foreach ($tags as $tag) {
echo "<a href='" . get_category_link($tag -> term_id) . "' target='_blank' class='tag badge badge-secondary post-meta-detail-tag'>" . $tag -> name . "</a>";
}
?>
</div>
<?php } ?>
</article>

View File

@@ -0,0 +1,45 @@
<?php
global $emotionListDefault;
$emotionList = apply_filters("argon_emotion_list", $emotionListDefault);
?>
<div id="emotion_keyboard" class="emotion-keyboard card shadow-sm bg-white">
<div class="emotion-keyboard-content">
<?php
foreach ($emotionList as $groupIndex => $group){
$className = "emotion-group";
if ($groupIndex != 0){
$className .= " d-none";
}
echo "<div class='" . $className . "' index='" . $groupIndex . "'>";
foreach ($group['list'] as $index => $emotion){
if (isset($emotion['title'])){
$title = $emotion['title'];
}else{
$title = "";
}
if ($emotion['type'] == 'text'){
echo "<div class='emotion-item' text='" . esc_attr($emotion['text']) . "' title='" . esc_attr($title) . "'>" . esc_html($emotion['text']) . "</div>";
}
if ($emotion['type'] == 'sticker'){
echo "<div class='emotion-item emotion-item-sticker' code='" . $emotion['code'] . "' title='" . esc_attr($title) . "'><img class='lazyload' src='data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iZW1vdGlvbi1sb2FkaW5nIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9Ii04IC04IDQwIDQwIiBzdHJva2U9IiM4ODgiIG9wYWNpdHk9Ii41IiB3aWR0aD0iNjAiIGhlaWdodD0iNjAiPgogIDxwYXRoIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIxLjUiIGQ9Ik0xNC44MjggMTQuODI4YTQgNCAwIDAxLTUuNjU2IDBNOSAxMGguMDFNMTUgMTBoLjAxTTIxIDEyYTkgOSAwIDExLTE4IDAgOSA5IDAgMDExOCAweiIvPgo8L3N2Zz4=' data-original='" . $emotion['src'] . "'/></div>";
}
}
if (isset($group['description'])){
echo "<div class='emotion-group-description'>" . $group['description'] . "</div>";
}
echo "</div>";
}
?>
</div>
<div class="emotion-keyboard-bar">
<?php
foreach ($emotionList as $groupIndex => $group){
$className = "emotion-group-name";
if ($groupIndex == 0){
$className .= " active";
}
echo "<div class='" . $className . "' index='" . $groupIndex . "'>" . $group['groupname'] . "</div>";
}
?>
</div>
</div>

View File

@@ -0,0 +1,210 @@
<!-- 文章操作按钮:分享和评论 -->
<div id="post_actions_container">
<!-- 分享功能 -->
<?php if (get_option("argon_show_sharebtn") != 'false') { ?>
<div id="share_container">
<div id="share" data-initialized="true">
<?php if (get_option('argon_show_sharebtn') != 'abroad') { ?>
<a target="_blank" class="no-pjax icon-douban" tooltip="<?php _e('分享到豆瓣', 'argon'); ?>">
<button class="btn btn-icon btn-primary" style="background: #209261;border: none;">
<span aria-hidden="true">豆</span>
</button>
</a>
<a target="_blank" class="no-pjax icon-qq" tooltip="<?php _e('分享到 QQ', 'argon'); ?>">
<button class="btn btn-icon btn-primary" style="background: #2196f3;border: none;">
<span class="btn-inner--icon"><i class="fa fa-qq"></i></span>
</button>
</a>
<a target="_blank" class="no-pjax icon-qzone" tooltip="<?php _e('分享到 QQ 空间', 'argon'); ?>">
<button class="btn btn-icon btn-primary" style="background: #ffc107;border: none;">
<span class="btn-inner--icon"><i class="fa fa-star"></i></span>
</button>
</a>
<a target="_blank" class="no-pjax icon-weibo" tooltip="<?php _e('分享到微博', 'argon'); ?>">
<button class="btn btn-icon btn-warning">
<span class="btn-inner--icon"><i class="fa fa-weibo"></i></span>
</button>
</a>
<?php } if (get_option('argon_show_sharebtn') != 'domestic') { ?>
<a target="_blank" class="no-pjax icon-facebook" tooltip="<?php _e('分享到 Facebook', 'argon'); ?>">
<button class="btn btn-icon btn-primary" style="background: #283593;border: none;">
<span class="btn-inner--icon"><i class="fa fa-facebook"></i></span>
</button>
</a>
<a target="_blank" class="no-pjax icon-twitter" tooltip="<?php _e('分享到 Twitter', 'argon'); ?>">
<button class="btn btn-icon btn-primary" style="background: #03a9f4;border: none;">
<span class="btn-inner--icon"><i class="fa fa-twitter"></i></span>
</button>
</a>
<a target="_blank" class="no-pjax icon-telegram" href="https://telegram.me/share/url?url=<?php echo urlencode($_SERVER['HTTP_HOST']);?>&text=<?php echo urlencode(html_entity_decode(get_the_title()));?>" tooltip="<?php _e('分享到 Telegram', 'argon'); ?>">
<button class="btn btn-icon btn-primary" style="background: #42a5f5;border: none;">
<span class="btn-inner--icon"><i class="fa fa-telegram"></i></span>
</button>
</a>
<?php } ?>
<a target="_blank" class="no-pjax icon-copy-link" id="share_copy_link">
<button class="btn btn-icon btn-default">
<span class="btn-inner--icon"><i class="fa fa-link"></i></span>
</button>
<div class="wechat-qrcode">
<h4><?php _e('扫描二维码', 'argon'); ?></h4>
<div class="qrcode" id="copy_link_qrcode"></div>
<div class="help"><?php _e('扫描二维码或点击复制链接', 'argon'); ?></div>
</div>
</a>
</div>
<button id="share_show" class="btn btn-icon btn-primary" tooltip="<?php _e('分享', 'argon'); ?>">
<span class="btn-inner--icon"><i class="fa fa-share"></i></span>
</button>
</div>
<?php } ?>
<!-- 评论切换按钮 -->
<?php if (comments_open() || get_comments_number()) { ?>
<button id="comments_toggle" class="btn btn-primary">
<span class="btn-inner--icon"><i class="fa fa-comments"></i></span>
<span class="btn-inner--text"><?php _e('展开评论', 'argon'); ?></span>
</button>
<?php } ?>
</div>
<script type="text/javascript">
(function() {
// 分享功能
<?php if (get_option("argon_show_sharebtn") != 'false') { ?>
socialShare("#share", {
title: '<?php echo addslashes(html_entity_decode(get_the_title())); ?>',
description: '<?php echo addslashes(html_entity_decode(wp_trim_words(html_entity_decode(get_the_content()), 50)));?>',
wechatQrcodeTitle: "<?php _e('分享到微信', 'argon');?>",
wechatQrcodeHelper: '<?php _e('微信扫描二维码', 'argon');?>',
source: '<?php global $post; echo get_permalink($post -> ID); ?>'
});
$("#share_show")[0].onclick = function() {
$("#share_container").addClass("opened");
};
// 点击其他地方关闭分享
$(document).on('click', function(e) {
if (!$(e.target).closest('#share_container').length) {
$("#share_container").removeClass("opened");
}
});
// 生成复制链接的二维码
$(document).ready(function() {
function initQRCode() {
if (typeof QRCode !== 'undefined') {
new QRCode(document.getElementById("copy_link_qrcode"), {
text: window.location.href,
width: 128,
height: 128,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: QRCode.CorrectLevel.M
});
} else {
$("#copy_link_qrcode").html('<img src="https://api.qrserver.com/v1/create-qr-code/?size=128x128&data=' + encodeURIComponent(window.location.href) + '" alt="QR Code" style="width: 128px; height: 128px;">');
}
}
setTimeout(initQRCode, 100);
});
$("#share_copy_link")[0].onclick = function() {
let input = document.createElement('input');
document.body.appendChild(input);
input.setAttribute("value", window.location.href);
input.setAttribute("readonly", "readonly");
input.setAttribute("style", "opacity: 0;pointer-events:none;");
input.select();
if (document.execCommand('copy')) {
iziToast.show({
title: '<?php _e('链接已复制', 'argon');?>',
message: "<?php _e('链接已复制到剪贴板', 'argon');?>",
class: 'shadow',
position: 'topRight',
backgroundColor: '#2dce89',
titleColor: '#ffffff',
messageColor: '#ffffff',
iconColor: '#ffffff',
progressBarColor: '#ffffff',
icon: 'fa fa-check',
timeout: 5000
});
} else {
iziToast.show({
title: '<?php _e('复制失败', 'argon');?>',
message: "<?php _e('请手动复制链接', 'argon');?>",
class: 'shadow',
position: 'topRight',
backgroundColor: '#f5365c',
titleColor: '#ffffff',
messageColor: '#ffffff',
iconColor: '#ffffff',
progressBarColor: '#ffffff',
icon: 'fa fa-close',
timeout: 5000
});
}
document.body.removeChild(input);
};
<?php } ?>
// 评论切换功能
<?php if (comments_open() || get_comments_number()) { ?>
var commentsToggleBtn = $("#comments_toggle");
if (commentsToggleBtn.length > 0) {
commentsToggleBtn[0].onclick = function() {
var commentsArea = $("#comments");
var postCommentArea = $("#post_comment");
var icon = commentsToggleBtn.find("i");
var text = commentsToggleBtn.find(".btn-inner--text");
if (commentsArea.hasClass("comments-collapsed")) {
commentsArea.removeClass("comments-collapsed");
commentsToggleBtn.addClass("expanded");
setTimeout(function() {
postCommentArea.removeClass("comments-collapsed");
}, 150);
icon.removeClass("fa-comments").addClass("fa-comment-o");
text.text("<?php _e('折叠评论', 'argon'); ?>");
setTimeout(function() {
if (commentsArea.length > 0) {
$('html, body').animate({
scrollTop: commentsArea.offset().top - 100
}, 500);
}
}, 300);
} else {
postCommentArea.addClass("comments-collapsed");
commentsToggleBtn.removeClass("expanded");
setTimeout(function() {
commentsArea.addClass("comments-collapsed");
}, 150);
icon.removeClass("fa-comment-o").addClass("fa-comments");
text.text("<?php _e('展开评论', 'argon'); ?>");
}
};
// 初始化按钮状态
$(document).ready(function() {
var commentsArea = $("#comments, #post_comment");
var icon = commentsToggleBtn.find("i");
var text = commentsToggleBtn.find(".btn-inner--text");
if (commentsArea.hasClass("comments-collapsed")) {
icon.removeClass("fa-comment-o").addClass("fa-comments");
text.text("<?php _e('展开评论', 'argon'); ?>");
commentsToggleBtn.removeClass("expanded");
} else {
icon.removeClass("fa-comments").addClass("fa-comment-o");
text.text("<?php _e('折叠评论', 'argon'); ?>");
commentsToggleBtn.addClass("expanded");
}
});
}
<?php } ?>
})();
</script>

View File

@@ -0,0 +1,26 @@
<div class="shuoshuo-operations">
<a href="<?php the_permalink(); ?>#post_comment" class="shuoshuo-preview-add-comment-out-container-a" <?php if (!comments_open()) {?>style="pointer-events: none;"<?php } ?>>
<button class="shuoshuo-preview-add-comment btn btn-icon btn-outline-primary btn-sm" type="button"<?php if (!comments_open()) {?> disabled<?php } ?>>
<span class="btn-inner--icon"><i class="fa fa-comments-o"></i></span>
<?php
$comment_count = get_post(get_the_ID()) -> comment_count;
if ($comment_count > 0){ ?>
<span class="btn-inner--text" style="margin-left: 2px;"><?php echo $comment_count;?></span>
<?php } else { ?>
<span class="btn-inner--text" style="margin-left: 2px;"><?php _e('评论', 'argon'); if (!comments_open()) { _e('已关闭', 'argon'); } ?></span>
<?php } ?>
</button>
</a>
<?php
$upvotedList = isset($_COOKIE['argon_shuoshuo_upvoted']) ? $_COOKIE['argon_shuoshuo_upvoted'] : '';
$upvoted = in_array(get_the_ID(), explode(',', $upvotedList));
?>
<button class="shuoshuo-upvote btn btn-icon btn-outline-primary btn-sm<?php if ($upvoted) {?> upvoted<?php } ?>" type="button" data-id="<?php the_ID(); ?>">
<span class="btn-inner--icon"><i class="fa fa-thumbs<?php if (!$upvoted) {?>-o<?php } ?>-up"></i></span>
<span class="btn-inner--text" style="margin-left: 2px;">
<span class="shuoshuo-upvote-num"><?php echo get_shuoshuo_upvotes(get_the_ID());?></span>
<i class="fa fa-spinner fa-spin" style="margin-left: 0;"></i>
</span>
</button>
</div>