Skip to content

Commit

Permalink
0.57
Browse files Browse the repository at this point in the history
  • Loading branch information
solstice23 committed Oct 28, 2019
1 parent 1cc93a3 commit 9e08814
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ Argon - 一个轻盈、简洁、美观的 WordPress 主题

# 更新日志

## 20191029 v0.57
+ 增加 题图(特色图片) 的支持

## 20191026 v0.56
+ 提升 Mathjax 版本到 3.0
+ 更换默认 Mathjax CDN
Expand Down
12 changes: 12 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
}
function theme_slug_setup() {
add_theme_support('title-tag');
add_theme_support('post-thumbnails');
}
add_action('after_setup_theme','theme_slug_setup');
//检测更新
Expand Down Expand Up @@ -990,6 +991,16 @@ function themeoptions_page(){
字/分钟
</p>

<h2>文章头图 (特色图片)</h2>
<h4>阅读界面中文章头图的位置</h4>
<p>
<select name="argon_show_thumbnail_in_banner_in_content_page">
<?php $argon_show_thumbnail_in_banner_in_content_page = get_option('argon_show_thumbnail_in_banner_in_content_page'); ?>
<option value="false" <?php if ($argon_show_thumbnail_in_banner_in_content_page=='false'){echo 'selected';} ?>>文章卡片顶端</option>
<option value="true" <?php if ($argon_show_thumbnail_in_banner_in_content_page=='true'){echo 'selected';} ?>>Banner (顶部背景)</option>
</select>
</p>

<h2>分享</h2>
<h4>显示文章分享按钮</h4>
<p>
Expand Down Expand Up @@ -1226,6 +1237,7 @@ function themeoptions_page(){
update_option('argon_enable_timezone_fix', $_POST['argon_enable_timezone_fix']);
update_option('argon_donate_qrcode_url', $_POST['argon_donate_qrcode_url']);
update_option('argon_hide_shortcode_in_preview', $_POST['argon_hide_shortcode_in_preview']);
update_option('argon_show_thumbnail_in_banner_in_content_page', $_POST['argon_show_thumbnail_in_banner_in_content_page']);


//LazyLoad 相关
Expand Down
4 changes: 2 additions & 2 deletions info.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version" : "0.56",
"version" : "0.57",
"details_url" : "https://github.com/abc2237512422/argon-theme/releases",
"download_url" : "https://github.com/abc2237512422/argon-theme/releases/download/v0.56/argon.zip"
"download_url" : "https://github.com/abc2237512422/argon-theme/releases/download/v0.57/argon.zip"
}
33 changes: 32 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Theme Name: argon
Author: abc2237512422
Author URI: https://abc233.site/
Description: 轻盈、简洁、美观的 Wordpress 主题
Version: 0.56
Version: 0.57
License: MIT License
License URI: https://opensource.org/licenses/MIT
Tags: 简约, 两栏, 侧栏在左边, 浮动侧栏, 文章目录, 自适应, 夜间模式, 可自定义
Expand Down Expand Up @@ -654,6 +654,37 @@ html.darkmode #float_action_buttons #fab_toggle_darkmode:before{
margin-left: 2px;
margin-right: 2px;
}
.post-header.post-header-with-thumbnail {
margin: -30px -30px 35px -30px;
border-radius: .25rem .25rem 0 0;
overflow: hidden;
position: relative;
}
.post-thumbnail {
width: 100%;
min-height: 200px;
max-height: 25vh;
object-fit: cover;
pointer-events: none;
}
.single .post-thumbnail , .page .post-thumbnail {
max-height: 30vh;
}
.post-header.post-header-with-thumbnail .post-header-text-container {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
color: #fff;
opacity: 0.9;
padding-bottom: 35px;
padding-top: 35px;
background: rgba(0,0,0,.05);
background: linear-gradient(to top, rgba(0,0,0,.3) 20%, rgba(0,0,0,0));
}
.post-header.post-header-with-thumbnail .post-header-text-container a {
color: #8f95ff !important;
}
.post-content{
line-height: 1.8;
margin-bottom: 10px;
Expand Down
23 changes: 22 additions & 1 deletion template-parts/content-page.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
<article class="post card bg-white shadow-sm border-0" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="post-header text-center">
<header class="post-header text-center<?php if (has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){echo " post-header-with-thumbnail";}?>">
<?php
if (has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){
$thumbnail_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), full)[0];
echo "<img class='post-thumbnail' src='" . $thumbnail_url . "'></img>";
echo "<div class='post-header-text-container'>";
}
if (has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') == 'true'){
$thumbnail_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), full)[0];
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 if ( is_sticky() && is_home() && ! is_paged() ) : ?>
Expand Down Expand Up @@ -64,6 +80,11 @@
</div>
<?php } ?>
</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">
Expand Down
23 changes: 22 additions & 1 deletion template-parts/content-single.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
<article class="post card bg-white shadow-sm border-0" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="post-header text-center">
<header class="post-header text-center<?php if (has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){echo " post-header-with-thumbnail";}?>">
<?php
if (has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') != 'true'){
$thumbnail_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), full)[0];
echo "<img class='post-thumbnail' src='" . $thumbnail_url . "'></img>";
echo "<div class='post-header-text-container'>";
}
if (has_post_thumbnail() && get_option('argon_show_thumbnail_in_banner_in_content_page') == 'true'){
$thumbnail_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), full)[0];
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 if ( is_sticky() && is_home() && ! is_paged() ) : ?>
Expand Down Expand Up @@ -62,6 +78,11 @@
</div>
<?php } ?>
</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">
Expand Down
14 changes: 13 additions & 1 deletion template-parts/content.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<article class="post card bg-white shadow-sm border-0" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="post-header text-center">
<header class="post-header text-center<?php if (has_post_thumbnail()){echo " post-header-with-thumbnail";}?>">
<?php
if (has_post_thumbnail()){
$thumbnail_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), full)[0];
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 if ( is_sticky() && is_home() && ! is_paged() ) : ?>
Expand Down Expand Up @@ -62,6 +69,11 @@
</div>
<?php } ?>
</div>
<?php
if (has_post_thumbnail()){
echo "</div>";
}
?>
</header>

<div class="post-content">
Expand Down

0 comments on commit 9e08814

Please sign in to comment.