diff --git a/functions.php b/functions.php index d09030a..50712da 100644 --- a/functions.php +++ b/functions.php @@ -135,6 +135,13 @@ function my_enqueue_scripts() { } add_action( 'wp_enqueue_scripts', 'my_enqueue_scripts', 1 ); +//加速 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/"), "//cdn.v2ex.com/gr", $avatar); + return $avatar; +} +add_filter( 'get_avatar', 'replace_gravatar' ); + //来自知更鸟的评论带图 add_action('comment_text', 'comments_embed_img', 2); function comments_embed_img($comment) { @@ -168,4 +175,14 @@ function mail_smtp( $phpmailer ) { $phpmailer->IsSMTP(); } +//修改每页显示的文章数 +function custom_posts_per_page($query){ + if(is_home()){ + $query->set('posts_per_page',get_RnMaterial('posts_num','5'));//首页每页显示8篇文章 + } + if(is_search()){ + $query->set('posts_per_page',-1);//搜索页显示所有匹配的文章,不分页 + } +} +add_action('pre_get_posts','custom_posts_per_page'); ?> diff --git a/img/random/material-1.png b/img/random/material-1.png new file mode 100644 index 0000000..df67677 Binary files /dev/null and b/img/random/material-1.png differ diff --git a/img/random/material-10.png b/img/random/material-10.png new file mode 100644 index 0000000..b08eeef Binary files /dev/null and b/img/random/material-10.png differ diff --git a/img/random/material-11.png b/img/random/material-11.png new file mode 100644 index 0000000..49afebe Binary files /dev/null and b/img/random/material-11.png differ diff --git a/img/random/material-12.png b/img/random/material-12.png new file mode 100644 index 0000000..4b4d694 Binary files /dev/null and b/img/random/material-12.png differ diff --git a/img/random/material-13.png b/img/random/material-13.png new file mode 100644 index 0000000..2298964 Binary files /dev/null and b/img/random/material-13.png differ diff --git a/img/random/material-14.png b/img/random/material-14.png new file mode 100644 index 0000000..6dbaf87 Binary files /dev/null and b/img/random/material-14.png differ diff --git a/img/random/material-15.png b/img/random/material-15.png new file mode 100644 index 0000000..33c0cfd Binary files /dev/null and b/img/random/material-15.png differ diff --git a/img/random/material-16.png b/img/random/material-16.png new file mode 100644 index 0000000..0fe201b Binary files /dev/null and b/img/random/material-16.png differ diff --git a/img/random/material-17.png b/img/random/material-17.png new file mode 100644 index 0000000..cf7139e Binary files /dev/null and b/img/random/material-17.png differ diff --git a/img/random/material-18.png b/img/random/material-18.png new file mode 100644 index 0000000..01742e3 Binary files /dev/null and b/img/random/material-18.png differ diff --git a/img/random/material-19.png b/img/random/material-19.png new file mode 100644 index 0000000..2fecb79 Binary files /dev/null and b/img/random/material-19.png differ diff --git a/img/random/material-2.png b/img/random/material-2.png new file mode 100644 index 0000000..49f0a5f Binary files /dev/null and b/img/random/material-2.png differ diff --git a/img/random/material-3.png b/img/random/material-3.png new file mode 100644 index 0000000..a4a7cca Binary files /dev/null and b/img/random/material-3.png differ diff --git a/img/random/material-4.png b/img/random/material-4.png new file mode 100644 index 0000000..aa849aa Binary files /dev/null and b/img/random/material-4.png differ diff --git a/img/random/material-5.png b/img/random/material-5.png new file mode 100644 index 0000000..6c2c58b Binary files /dev/null and b/img/random/material-5.png differ diff --git a/img/random/material-6.png b/img/random/material-6.png new file mode 100644 index 0000000..a3f2a1f Binary files /dev/null and b/img/random/material-6.png differ diff --git a/img/random/material-7.png b/img/random/material-7.png new file mode 100644 index 0000000..1919fcb Binary files /dev/null and b/img/random/material-7.png differ diff --git a/img/random/material-8.png b/img/random/material-8.png new file mode 100644 index 0000000..18f7da3 Binary files /dev/null and b/img/random/material-8.png differ diff --git a/img/random/material-9.png b/img/random/material-9.png new file mode 100644 index 0000000..e2779f4 Binary files /dev/null and b/img/random/material-9.png differ diff --git a/img/sidebar.jpg b/img/sidebar.jpg index d5dcd1d..0b108f7 100644 Binary files a/img/sidebar.jpg and b/img/sidebar.jpg differ diff --git a/index.php b/index.php index 73f4d8e..c4d123a 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,6 @@ +publish;?> +
@@ -61,7 +63,7 @@
-
)"> +
)">

@@ -84,22 +86,12 @@ + $post_nn){ ?> - +
diff --git a/options.php b/options.php index 217c236..09462ed 100644 --- a/options.php +++ b/options.php @@ -98,6 +98,15 @@ function optionsframework_options() { 'type' => 'heading' ); + $options[] = array( + 'name' => __( '首页显示文章数', 'theme-textdomain' ), + 'desc' => __( '请输入整数,不要留空,留空时默认为 5', 'theme-textdomain' ), + 'id' => 'posts_num', + 'std' => '5', + 'class' => 'mini', + 'type' => 'text' + ); + $options[] = array( 'name' => __( '背景颜色', 'theme-textdomain' ), 'desc' => __( '请输入 RGB 值,不要留空,留空时背景纯白。默认为 #dedede', 'theme-textdomain' ), diff --git a/page.php b/page.php index c5f2de2..513112d 100644 --- a/page.php +++ b/page.php @@ -10,7 +10,7 @@
-
)"> +
)">

diff --git a/pages/page-archieve.php b/pages/page-archieve.php index c13405e..fea00d0 100644 --- a/pages/page-archieve.php +++ b/pages/page-archieve.php @@ -17,7 +17,7 @@
-
)"> +
)">

diff --git a/pages/page-links.php b/pages/page-links.php index a218b76..5676da2 100644 --- a/pages/page-links.php +++ b/pages/page-links.php @@ -15,7 +15,7 @@
-
)"> +
)">

diff --git a/search.php b/search.php index 3cb4f79..3805f5a 100644 --- a/search.php +++ b/search.php @@ -22,7 +22,7 @@
- neoFelhz's avatar
+
diff --git a/single.php b/single.php index aaf3626..bf893d7 100644 --- a/single.php +++ b/single.php @@ -10,7 +10,7 @@
-
)"> +
)">

diff --git a/style.css b/style.css index 6918424..ae296d9 100644 --- a/style.css +++ b/style.css @@ -1,10 +1,10 @@ /* Theme Name: RnMaterial -Theme URI: https://jakting.com +Theme URI: https://github.com/hjthjthjt/rnmaterial Author: Jartip Hwang Author URI: https://jakting.com Description: Maybe it is the best Material Design WordPress Theme. This Theme is Migrated from hexo-theme-material(https://github.com/viosey/hexo-theme-material) -Version: 2.0 +Version: 2.0.1 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