Skip to content
This repository has been archived by the owner on Sep 12, 2020. It is now read-only.

Commit

Permalink
feature(all): add gravatar custom mirror domain
Browse files Browse the repository at this point in the history
  • Loading branch information
TigerBeanst committed Feb 2, 2020
1 parent 892e819 commit 7a6433b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function my_enqueue_scripts()
//使用官方中文源加速 Gravatar 头像
function replace_gravatar($avatar)
{
$avatar = str_replace(array("//gravatar.com/", "//secure.gravatar.com/", "//www.gravatar.com/", "//0.gravatar.com/", "//1.gravatar.com/", "//2.gravatar.com/", "//cn.gravatar.com/"), "//cn.gravatar.com/", $avatar);
$avatar = str_replace(array("//gravatar.com/", "//secure.gravatar.com/", "//www.gravatar.com/", "//0.gravatar.com/", "//1.gravatar.com/", "//2.gravatar.com/", "//cn.gravatar.com/"), "//".getTigerMaterial('tm_gravatar')."/", $avatar);
return $avatar;
}

Expand Down
8 changes: 8 additions & 0 deletions options.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ function optionsframework_options() {
'type' => 'text'
);

$options[] = array(
'name' => __('Gravatar 头像加速', 'theme-textdomain'),
'desc' => __('请填入加速域名,比如七牛之类的。末尾请不要带有 / 。<b>默认为 cn.gravatar.com</b>', 'theme-textdomain'),
'id' => 'tm_gravatar',
'std' => 'cn.gravatar.com',
'type' => 'text'
);

$options[] = array(
'name' => __('Creative Commons 授权方式', 'theme-textdomain'),
'desc' => __('请填入所选择的 CC 授权方式,最终会在网页底部及文章结尾出现。<b>默认为 CC BY-NC-SA 3.0</b>', 'theme-textdomain'),
Expand Down
5 changes: 2 additions & 3 deletions page.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class="mdui-text-color-white tm-index-single-title"><?php the_title(); ?></span>
<div class="mdui-card-actions mdui-color-white">
<div class="mdui-typo mdui-typo-subheading mdui-m-a-4 mdui-text-color-grey-600">
<span class="byline-name" style="display: none"><?php the_author(); ?></span>
<p><?php $content = article_toc(get_the_content(null, false));
echo the_content(); ?></p>
<p><?php $content = article_toc(apply_filters( 'the_content', get_the_content()));
echo $content[0]?></p>
<?php if (!$content[2]) {//没有目录?>
<button id="toTop"
class="mdui-fab mdui-fab-fixed mdui-ripple mdui-color-grey-700"
Expand Down Expand Up @@ -105,7 +105,6 @@ class="mdui-ripple">分享到 Facebook</a>
</div>
</div>
</div>
<?php comments_template(); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
Expand Down
2 changes: 0 additions & 2 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class="mdui-text-color-white tm-index-single-title"><?php the_title(); ?></span>
<div class="mdui-typo mdui-typo-subheading mdui-m-a-4 mdui-text-color-grey-600">
<span class="byline-name" style="display: none"><?php the_author(); ?></span>
<p><?php $content = article_toc(apply_filters( 'the_content', get_the_content()));
//the_content();
//echo apply_filters( 'the_content', get_the_content());
echo $content[0]?></p>
<?php if (!$content[2]) {//没有目录?>
<button id="toTop"
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: https://jakting.com/archives/tigermaterial.html
Author: hjthjthjt
Author URI: https://jakting.com
Description: Another Material Design WordPress Theme.
Version: 1.0.1
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: white, light, one-column, material
Expand Down

0 comments on commit 7a6433b

Please sign in to comment.