Coder Social home page Coder Social logo

mashirozx / sakura Goto Github PK

View Code? Open in Web Editor NEW
3.5K 41.0 587.0 44.65 MB

A Wonderful WordPress Theme: 樱花庄的白猫博客主题

Home Page: https://2heng.xin/theme-sakura/

License: GNU General Public License v2.0

PHP 56.46% CSS 26.16% JavaScript 16.67% Python 0.71%
wordpress theme

sakura's Introduction

Sakura🌸: 樱花庄的白猫博客主题

中文 | English

Sakura

PHP version WP version GitHub release Github commits (since latest release)

在 Louie 基于 Fuzzz 的 Akina 主题修改的主题 Siren 基础上三次修改 =.=

两位前辈做得已经很棒了,或许我所做的只是把他们的代码弄得凌乱不堪吧 :)

特别感谢 @Spirit 对本项目的贡献!

注意:建议 git clone 下载(简易 Git 使用指南);如果选择下载压缩包,解压后记得把文件夹名改回 Sakura,也即保证主题路径为 /wp-content/themes/Sakura/;主题设置在 菜单-外观-Sakura 主题设置 中;DIY 的时候建议采用子主题 并勾选 Sakura 主题设置-CDN-本地调用主题 js、css 文件;请留意主题说明里的其他注意事项。

主题使用说明见:https://2heng.xin/theme-sakura/

本仓库国内镜像:https://git.moezx.cc/mirrors/sakura

主题交流群:860262481

希望你喜欢!

打赏支持~

微信支付 | 支付宝 | PayPal

需要服务器吗?

sakura's People

Contributors

aierlma avatar akikohaku avatar enjoyuruf avatar himehane avatar imgbot[bot] avatar jkkoi avatar kot4ri avatar laxse avatar mashirozx avatar mmm25002500 avatar muenyu avatar spirit1431007 avatar verfasor avatar whymesay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sakura's Issues

如何启动

我是做后台的,完全是一个小白,请问如何启动这个主题呢,希望能指点一下

1头像加载较慢2自定义一言

1、gravatar.shino.cc可能人使用比较多,有些地方再状态栏加载老半天,可否考虑在下一版 改为本地头像库或api

2、能加入自定义看板娘在后台 选择最好了,https://imjad.cn/archives/lab/add-dynamic-poster-girl-with-live2d-to-your-blog-03 推荐这个血小板

3、现在 博主介绍里 只有一句话,在下一版中如果加入 可以自己选择的 一言api最好了,比如

function getHitokoto() {
$.ajax({
url: "http://2sr.likeqi.cn/api.php?encode=jsc&cat=a&charset=utf-8&length=50",
dataType: "jsonp",
async: true,
jsonp: "callback",
jsonpCallback: "hitokoto",
success: function(result) {
$('#hitokoto').html("

" + result.hitokoto + "

")
},
error: function() {
$('#hitokoto').html("

读取数据失败了的说……(:з」∠)

")
}
});
}
getHitokoto()

wordpress后台js错误

错误:

Uncaught TypeError: Cannot read property 'addEventListener' of null
    at window.onload

由于文件太多,实在是找不到这个文件在哪(菜的抠jo,2333
确认是主题引起的,因为更换主题后错误消失

错误位置:

<script>
    window.onload=function(){
        lazyload();
        
        //这里加个判空应该就可以避免问题了
        document.querySelector("#scheme-tip .notice-dismiss").addEventListener("click", function(){
            location.href="?scheme-tip-dismissed1";
        });
    }
</script>

自动提取文章第一张图片并设为缩略图

建议

当文章无特色图时,自动提取文章第一张图片并设为缩略图,这是我以前用的主题的,略微修改

//自动提取文章第一张图片并设为缩略图
function post_thumbnail_src(){
    global $post, $posts;
	if( has_post_thumbnail() ){    //如果有特色缩略图,则输出缩略图地址
        $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'large');
		$post_img = $large_image_url[0];
    } else {			//如果文章中没有特色缩略图,则显示文章中第一张图片
		$post_img = '';
		ob_start();
		ob_end_clean();
		$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
		$post_img = $matches [1] [0];   //获取该图片 src
		if(empty($post_img)){	//如果文章中没有图片,则显示随机图片
			$random = mt_rand(1, 32);
			$post_img = get_bloginfo('template_url').'/images/pic/'.$random.'.jpg';
		}
	};
	return $post_img;
}

修复一下Aplayer样式、移动适配

主题中我忘记默认引入 Aplayer 的 CSS 了,如果要使用任何 Aplayer 的功能请手动引入一下 Aplayer 的 CSS(下方),或者安装插件 Hermit X,下一次更新我会修复这个问题的,目前暂时带来不便请谅解。

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/APlayer.min.css">

建议直接安装插件,另外安装后注意配置:
image

如果使用了缓存插件,修改之后记得刷新缓存。

好像无法加载footer.php的内容?

试搭在两家主机商上都出现了这个问题,一开始以为是配置问题。重置几回还有问题后发现footer的内容都没有被加载。也是程序之外的问题?请dalao们指教指教orz

wnmp Control panel的MariaDB Running叉号 Can't find file: '.\mysql\user.MYI'

e2018-10-27 18:38:25 8448 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1932: Table 'mysql.gtid_slave_pos' doesn't exist in engine

2018-10-27 18:38:25 4656 [ERROR] Can't open and lock privilege tables: Can't find file: '.\mysql\servers.MYI' (errno: 2 "No such file or directory")

2018-10-27 18:38:25 4656 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: '.\mysql\user.MYI' (errno: 2 "No such file or directory")
在这里也提问一下吧 不知道是不是只有我遇到了这个问题,
如果大佬用邮箱回答的话,我会把答案搬运到这里。[2018-10-29 moler]

首页无法访问

您好!使用您的开源项目后访问时出现这个Fatal error: Uncaught Error: Call to undefined function get_header() in /Users/lc/Desktop/Sakura/index.php:14 Stack trace: #0 {main} thrown in /Users/lc/Desktop/Sakura/index.php on line 14 请问怎么解决呢!http请求返回时200,页面出现这个错误

Switch From Adobe Typekit to Google Fonts!

Google Fonts had been supporting Chinese fonts for two months. Both Noto Sans and Noto Serif is supported. Please see https://fonts.google.com/?subset=chinese-simplified.

We all know that Google Fonts (Beijing & Shanghai BGP Datacenters) or its mirror site fonts.loli.net (Aliyun CDN) behave rather excellent in both China Mainland and other regions. But Adobe Typekit uses Akamai CDN which is not optimised in China and furthermore it does have multiple restrictions for free users.

So I would consider loading the Noto Serif that "Sakura" uses from Google Fonts (especially from fonts.loli.net will be a better solution). In addition, it does not require the users to register an Adobe ID to get the limited access to Typekit anymore!

第一屏视频无法播放

Uncaught ReferenceError: ap is not defined
at Object.splay (sakura-app.js?ver=3.0.7:1422)
at HTMLVideoElement.s.oncanplay (sakura-app.js?ver=3.0.7:1470)

pjax开启后不能加载目录

在Sakura Options 中开启PJAX局部刷新后由首页进入文章页面,文章目录不能显示,评论区表情插入"戳我试试 OωO"无法点击,刷新后正常。刷新后由文章页面进入首页,首页的文章列表不显示

The link you followed has expired.

请问一下,为什么安装的时候,上传100%就跳到这个页面,提示:The link you followed has expired.
然后就安装失败了。

关于摘要字数限制的问题

主题内的摘要字数限制似乎是失效的(或者说只能限制英文?)
我重新写了一个……(萌新……好像没办法直接pull,是GitHub太复杂了吗)
在function.php的1278行

/**
 * 改进版摘要长度限制
 * by Moment
 * https://momincong.xyz
 * https://vidaima.com
 */
function cn_excerpt($output) {
	$output = mb_substr($output,0, 100);
	return $output;
}
add_filter('the_excerpt', 'cn_excerpt');

这个新函数需要安装mbstring的php扩展,因为使用了mb_substr()函数。

I don't know how to use it

I tried to switch the my blog's theme to Sakura tonight, but I met errors when I just got the theme installed.

I've switched it back to my original theme, but you may see the error at https://testing.hxco.de

Firstly, the cover image cannot be displayed normally.

Secondly, the page cannot be scroll at all, and only the first article can be displayed.

Finally, if you enter any of the blog's article links, you can only see the article's title.

Nothing in the console, no 404 or 403 errors.

image

Version 3.0.6, under Lao Xue Hosts US Plan, cPanel Web Hosting.

已安装Hermit和加上判断条件还是报错

Uncaught ReferenceError: ap is not defined
at Object.splay (sakura-app.js?ver=3.0.7:1422)
at HTMLVideoElement.s.oncanplay (sakura-app.js?ver=3.0.7:1470)

请问已添加判断条件还是报错怎么办

Jiathis.com is not available in the theme

I have noticed that Sakura is using www.jiathis.com to reach the social sharing function at https://github.com/mashirozx/Sakura/blob/master/layouts/sharelike.php#L24.

But currently http://www.jiathis.com/send/?webid=weixin&url=https://example.com or http://www.jiathis.com/send/?webid=weixin&url= is returning a 404 error status code.

root@HXCO:~# curl -I http://www.jiathis.com/send/?webid=weixin&url=https://example.com
[1] 9541
root@HXCO:~# HTTP/1.1 404 Not Found
Server: nginx/1.12.2
Date: Thu, 27 Dec 2018 04:23:27 GMT
Content-Type: text/html
Content-Length: 169
Connection: keep-alive

Please consider to replace these www.jiathis.com APIs to their original ones like http://service.weibo.com/share/share.php?url=.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.