├── screenshot.png ├── languages ├── zh_CN.mo └── zh_CN.po ├── public ├── images │ ├── 404.png │ ├── logo.png │ ├── loading.gif │ ├── placeholder.png │ └── setting-icon.png ├── fonts │ ├── icomoon.eot │ ├── icomoon.ttf │ ├── icomoon.woff │ └── icomoon.svg ├── js │ ├── archives.js │ └── all.js └── css │ └── help.css ├── smiley ├── icon_arrow.png ├── icon_cool.png ├── icon_cry.png ├── icon_eek.png ├── icon_evil.png ├── icon_idea.png ├── icon_lol.png ├── icon_mad.png ├── icon_razz.png ├── icon_sad.png ├── icon_smile.png ├── icon_wink.png ├── icon_biggrin.png ├── icon_exclaim.png ├── icon_mrgreen.png ├── icon_neutral.png ├── icon_redface.png ├── icon_twisted.png ├── icon_confused.png ├── icon_question.png ├── icon_rolleyes.png └── icon_surprised.png ├── sidebar.php ├── page.php ├── templates ├── fullpage.php ├── page-link.php ├── page-category.php ├── page-about.php └── archives.php ├── footer.php ├── 404.php ├── functions ├── mutheme-main.php ├── mutheme-function.php ├── mutheme-widget.php ├── libraries │ └── theme-update-checker.php ├── mutheme-basic.php └── mutheme-settings.php ├── README.md ├── single.php ├── search.php ├── index.php ├── smiley.php ├── archive.php ├── header.php ├── comments.php ├── functions.php └── LICENSE /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/screenshot.png -------------------------------------------------------------------------------- /languages/zh_CN.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/languages/zh_CN.mo -------------------------------------------------------------------------------- /public/images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/public/images/404.png -------------------------------------------------------------------------------- /smiley/icon_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_arrow.png -------------------------------------------------------------------------------- /smiley/icon_cool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_cool.png -------------------------------------------------------------------------------- /smiley/icon_cry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_cry.png -------------------------------------------------------------------------------- /smiley/icon_eek.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_eek.png -------------------------------------------------------------------------------- /smiley/icon_evil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_evil.png -------------------------------------------------------------------------------- /smiley/icon_idea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_idea.png -------------------------------------------------------------------------------- /smiley/icon_lol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_lol.png -------------------------------------------------------------------------------- /smiley/icon_mad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_mad.png -------------------------------------------------------------------------------- /smiley/icon_razz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_razz.png -------------------------------------------------------------------------------- /smiley/icon_sad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_sad.png -------------------------------------------------------------------------------- /smiley/icon_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_smile.png -------------------------------------------------------------------------------- /smiley/icon_wink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_wink.png -------------------------------------------------------------------------------- /public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/public/images/logo.png -------------------------------------------------------------------------------- /smiley/icon_biggrin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_biggrin.png -------------------------------------------------------------------------------- /smiley/icon_exclaim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_exclaim.png -------------------------------------------------------------------------------- /smiley/icon_mrgreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_mrgreen.png -------------------------------------------------------------------------------- /smiley/icon_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_neutral.png -------------------------------------------------------------------------------- /smiley/icon_redface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_redface.png -------------------------------------------------------------------------------- /smiley/icon_twisted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_twisted.png -------------------------------------------------------------------------------- /public/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/public/fonts/icomoon.eot -------------------------------------------------------------------------------- /public/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/public/fonts/icomoon.ttf -------------------------------------------------------------------------------- /public/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/public/fonts/icomoon.woff -------------------------------------------------------------------------------- /public/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/public/images/loading.gif -------------------------------------------------------------------------------- /smiley/icon_confused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_confused.png -------------------------------------------------------------------------------- /smiley/icon_question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_question.png -------------------------------------------------------------------------------- /smiley/icon_rolleyes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_rolleyes.png -------------------------------------------------------------------------------- /smiley/icon_surprised.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/smiley/icon_surprised.png -------------------------------------------------------------------------------- /public/images/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/public/images/placeholder.png -------------------------------------------------------------------------------- /public/images/setting-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShenYun1/Kunkka/HEAD/public/images/setting-icon.png -------------------------------------------------------------------------------- /sidebar.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /page.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
> 5 |
6 |

8 |
9 |
10 |
11 |
12 |
13 | 14 | 15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /templates/fullpage.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 |
> 9 |
10 |

12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 |
20 | 21 | -------------------------------------------------------------------------------- /footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /templates/page-link.php: -------------------------------------------------------------------------------- 1 | 6 |
7 |
8 | '; 12 | foreach ($bookmarks as $bookmark) { 13 | echo '
  • '. get_avatar($bookmark->link_notes,80) . ''. $bookmark->link_name .'
  • '; 14 | } 15 | echo ''; 16 | } 17 | ?> 18 |
    19 |
    20 | 21 | 35 | 36 | -------------------------------------------------------------------------------- /public/js/archives.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function(a){ 2 | if( !bowser.mobile ){ 3 | var e=a("#content").offset().top,f=parseInt(a(".year:first").attr("id").replace("year-",""));a(".year:first, .year .month:first").addClass("selected");a(".month.monthed").click(function(){var b=a(this),c="#"+b.attr("id").replace("mont","arti");b.hasClass("selected")||(c=a(c).offset().top-10,a(".month.monthed.selected").removeClass("selected"),b.addClass("selected"),a("body, html").scrollTop(c))});a(".year-toogle").click(function(b){b.preventDefault();b=a(this).parent(); 4 | if(!b.hasClass("selected")){var c=a(".year.selected"),d=b.children("ul").children("li").eq(0);c.removeClass("selected");b.addClass("selected");d.click()}});a(window).scroll(function(){var b=a(this).scrollTop();b>=e+60?a(".archive-nav").css({top:60}):a(".archive-nav").css({top:e+60-b});a(".archive-title").each(function(){var c=a(this),d=c.attr("id"),g=parseInt(d.replace(/arti-(\d*)-\d*/,"$1")),e=c.offset().top-40,c=e+c.height();b>=e&&b 7 |
    8 |
    9 | 10 | <?php bloginfo( 'name' ); ?> 11 | 12 |

    Not Found

    13 |

    对不起,您访问的界面已迁移或不存在,即将返回首页

    14 |

    s

    15 |
    16 |
    17 | 18 | 24 | 41 | -------------------------------------------------------------------------------- /templates/page-category.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
    8 |
    9 |
    10 | Categories 11 |
    12 |
    13 | 14 |
    15 |
    16 |
    17 | Tags 18 |
    19 |
    20 | 'px', 22 | 'smallest' => 12, 23 | 'largest' => 12, 24 | 'number' => mutheme_settings( 'tag_number' ), 25 | 'format' => 'flat', 26 | 'orderby' => 'count', 27 | 'order' => 'DESC' 28 | ) ); ?> 29 |
    30 |
    31 |
    32 | 33 | 49 | -------------------------------------------------------------------------------- /functions/mutheme-main.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 | 9 | 10 |
    11 |
    12 |

    14 |
    15 | 34 |
    35 |
    36 |
    37 | 40 |
    41 | 42 | 43 |
    44 | 45 | 46 | -------------------------------------------------------------------------------- /templates/page-about.php: -------------------------------------------------------------------------------- 1 | 6 |
    7 |
    8 |
    9 | 10 |
    11 |
    12 |
    13 | 14 |    15 |    16 | 17 | 18 | 19 |
    20 | 21 |
    22 |
    23 |
    24 |
       25 | 26 |
    27 |
    28 |
    29 |
    北京邮电大学在读
    30 |
    文档 美工 程序员
    31 |
    32 | 33 |
    34 |
    35 | 36 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /search.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 | 9 |
    10 | 22 |
    23 |
    24 |

    25 | 26 |

    27 |
    28 | 49 |
    50 | 51 |
    52 | 53 | <?php the_title(); ?> 57 | 58 |
    59 |
    60 | %s

    ', mutheme_excerpt( $post->post_content, 320 ) ); ?> 61 |
    62 | 63 |
    64 | %s

    ', mutheme_excerpt( $post->post_content, 250 ) ); ?> 65 |
    66 | 67 |
    68 |
    69 | 70 |
    71 | 74 |
    75 | 76 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
    4 | 15 |
    16 |
    17 |

    18 | 19 | 20 | 21 | 22 |

    23 |
    24 | 45 |
    46 | 50 |
    51 | 52 | <?php the_title(); ?> 56 | 57 |
    58 |
    59 | %s

    ', mutheme_excerpt( $post->post_content, 320 ) ); ?> 60 |
    61 | 62 |
    63 | %s

    ', mutheme_excerpt( $post->post_content, 250 ) ); ?> 64 |
    65 | 67 |
    68 |
    69 | 70 |
    71 | 74 |
    75 | 76 | -------------------------------------------------------------------------------- /public/css/help.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Kunkka 3 | Version: 1.0.0 4 | Author: MuFeng 5 | Author URI: http://mufeng.me 6 | Description: 主题问题或建议可以联系, QQ群: 205883766, 邮箱: mufeng.me@gmail.com 7 | */ 8 | 9 | @font-face { 10 | font-family: 'mutheme-kunkka'; 11 | src: url('../fonts/icomoon.eot?dpiorb'); 12 | src: url('../fonts/icomoon.eot?dpiorb#iefix') format('embedded-opentype'), 13 | url('../fonts/icomoon.ttf?dpiorb') format('truetype'), 14 | url('../fonts/icomoon.woff?dpiorb') format('woff'), 15 | url('../fonts/icomoon.svg?dpiorb#icomoon') format('svg'); 16 | font-weight: normal; 17 | font-style: normal; 18 | } 19 | 20 | [class^="mutheme-"] { 21 | /* use !important to prevent issues with browser extensions that change fonts */ 22 | font-family: 'mutheme-kunkka'; 23 | speak: none; 24 | font-style: normal; 25 | font-weight: normal; 26 | font-variant: normal; 27 | text-transform: none; 28 | line-height: 1; 29 | 30 | /* Better Font Rendering =========== */ 31 | -webkit-font-smoothing: antialiased; 32 | -moz-osx-font-smoothing: grayscale; 33 | } 34 | 35 | .mutheme-layers:before { 36 | content: "\e900" 37 | } 38 | 39 | .mutheme-air:before { 40 | content: "\e901" 41 | } 42 | 43 | .mutheme-aircraft:before { 44 | content: "\e902" 45 | } 46 | 47 | .mutheme-drive:before { 48 | content: "\e905" 49 | } 50 | 51 | .mutheme-colours:before { 52 | content: "\e903" 53 | } 54 | 55 | .mutheme-compass:before { 56 | content: "\e904" 57 | } 58 | 59 | .mutheme-game:before { 60 | content: "\e906" 61 | } 62 | 63 | .mutheme-home:before { 64 | content: "\e907" 65 | } 66 | 67 | .mutheme-image:before { 68 | content: "\e908" 69 | } 70 | 71 | .mutheme-medal:before { 72 | content: "\e909" 73 | } 74 | 75 | .mutheme-mic:before { 76 | content: "\e90a" 77 | } 78 | 79 | .mutheme-rocket:before { 80 | content: "\e90b" 81 | } 82 | 83 | .mutheme-shop:before { 84 | content: "\e90c" 85 | } 86 | 87 | .mutheme-user:before { 88 | content: "\e90d" 89 | } 90 | 91 | .mutheme-instagram:before { 92 | content: "\e90e" 93 | } 94 | 95 | .mutheme-shop:before { 96 | content: "\e90c" 97 | } 98 | 99 | .mutheme-music:before { 100 | content: "\f001" 101 | } 102 | 103 | .mutheme-video:before { 104 | content: "\f16a" 105 | } 106 | 107 | .mutheme-apple:before { 108 | content: "\f179" 109 | } 110 | 111 | .mutheme-windows:before { 112 | content: "\f17a" 113 | } 114 | 115 | .mutheme-android:before { 116 | content: "\f17b" 117 | } 118 | 119 | .mutheme-twitter:before { 120 | content: "\f099" 121 | } 122 | 123 | .mutheme-github:before { 124 | content: "\f09b" 125 | } 126 | 127 | .mutheme-feed:before { 128 | content: "\f09e" 129 | } 130 | 131 | .mutheme-tablet:before { 132 | content: "\f10a" 133 | } 134 | 135 | .mutheme-mobile:before { 136 | content: "\f10b" 137 | } 138 | 139 | .mutheme-linux:before { 140 | content: "\f17c" 141 | } 142 | 143 | .mutheme-dribbble:before { 144 | content: "\f17d" 145 | } 146 | 147 | .mutheme-weibo:before { 148 | content: "\f18a" 149 | } 150 | 151 | .mutheme-wordpress:before { 152 | content: "\f19a" 153 | } 154 | 155 | .mutheme-qq:before { 156 | content: "\f1d6" 157 | } 158 | 159 | .mutheme-wechat:before { 160 | content: "\f1d7" 161 | } 162 | 163 | .mutheme-facebook:before { 164 | content: "\f230" 165 | } 166 | 167 | .mutheme-safari:before { 168 | content: "\f267" 169 | } 170 | 171 | .mutheme-chrome:before { 172 | content: "\f268" 173 | } 174 | 175 | .mutheme-firefox:before { 176 | content: "\f269" 177 | } 178 | 179 | .mutheme-opera:before { 180 | content: "\f26a" 181 | } 182 | 183 | .mutheme-ie:before { 184 | content: "\f26b" 185 | } 186 | 187 | .mutheme-edge:before { 188 | content: "\f282" 189 | } 190 | 191 | .mutheme-download:before { 192 | content: "\e609" 193 | } 194 | 195 | .mutheme-email:before { 196 | content: "\e60b" 197 | } 198 | 199 | .mutheme-tag:before { 200 | content: "\e602" 201 | } 202 | 203 | .mutheme-comment:before { 204 | content: "\e60c" 205 | } 206 | 207 | .mutheme-icon-list li { 208 | display: inline-block; 209 | width: 19.1%; 210 | margin-bottom: 10px; 211 | } 212 | 213 | .about-wrap .feature-section { 214 | padding-bottom: 20px; 215 | } 216 | 217 | code { 218 | background: #fafafa; 219 | } -------------------------------------------------------------------------------- /smiley.php: -------------------------------------------------------------------------------- 1 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 |
    -------------------------------------------------------------------------------- /archive.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 | 21 |
    22 | 34 |
    35 |
    36 |

    37 | 38 |

    39 |
    40 | 61 |
    62 | 63 |
    64 | 65 | <?php the_title(); ?> 69 | 70 |
    71 |
    72 | %s

    ', mutheme_excerpt( $post->post_content, 320 ) ); ?> 73 |
    74 | 75 |
    76 | %s

    ', mutheme_excerpt( $post->post_content, 250 ) ); ?> 77 |
    78 | 79 |
    80 |
    81 | 83 |
    84 | 87 |
    88 | 89 | -------------------------------------------------------------------------------- /templates/archives.php: -------------------------------------------------------------------------------- 1 | 6 |
    7 |
    8 | '; 12 | while ( $the_query->have_posts() ) : $the_query->the_post(); 13 | $year_tmp = get_the_time('Y'); 14 | $mon_tmp = get_the_time('n'); 15 | //var_dump($year_tmp); 16 | $y=$year; $m=$mon; 17 | if ($mon != $mon_tmp && $mon > 0) $output .= '
    '; 18 | if ($year != $year_tmp) { 19 | $year = $year_tmp; 20 | $all[$year] = array(); 21 | } 22 | 23 | if ($mon != $mon_tmp) { 24 | $mon = $mon_tmp; 25 | array_push($all[$year], $mon); 26 | $output .= "

    $year-$mon

    "; //输出月份 27 | } 28 | $output .= ''; //输出文章日期和标题 29 | endwhile; 30 | wp_reset_postdata(); 31 | $output .= '
    '; 32 | echo $output; 33 | 34 | $html = ""; 35 | $year_now = date("Y"); 36 | foreach($all as $key => $value){ 37 | $html .= "
  • $key
  • "; 43 | } 44 | ?> 45 | 46 |
    47 | 48 |
    49 | 50 | 141 | 142 | -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | > 12 | 104 | 105 |
    106 |
    -------------------------------------------------------------------------------- /functions/mutheme-function.php: -------------------------------------------------------------------------------- 1 | 'Kunkka 设置', 16 | 'href' => admin_url( 'admin.php?page=mutheme_setting' ), 17 | 'meta' => array( 18 | 'title' => 'Kunkka 设置' 19 | ) 20 | ); 21 | $wp_admin_bar->add_node( $args ); 22 | } 23 | 24 | /** 25 | * Theme comment walker 26 | * 27 | * @param $comment 28 | * @param $args 29 | * @param $depth 30 | */ 31 | function mutheme_comment( $comment, $args, $depth ) { 32 | $GLOBALS['comment'] = $comment; 33 | 34 | global $commentcount; 35 | 36 | if ( ! $commentcount ) { 37 | $page = ( ! empty( $in_comment_loop ) ) ? get_query_var( 'cpage' ) - 1 : get_page_of_comment( $comment->comment_ID, $args ) - 1; 38 | $cpp = get_option( 'comments_per_page' ); 39 | $commentcount = $cpp * $page; 40 | } 41 | 42 | if ( ! $comment->comment_parent ) { 43 | //$email = $comment->comment_author_email; 44 | $avatar = get_avatar( $comment, $size = '50' ); 45 | ?> 46 |
  • id="li-comment-"> 47 |
    48 |
    49 | 63 | 64 |
    65 | "> 68 | comment_date_gmt), true ); ?> 70 |
    71 |
    72 |
    $depth, 74 | 'max_depth' => $args['max_depth'], 75 | 'reply_text' => __( 'Reply', MUTHEME_NAME ) 76 | ) ) ) ?>
    77 |
    78 | 80 |
  • id="li-comment-"> 81 |
    82 |
    83 | $depth, 86 | 'max_depth' => $args['max_depth'], 87 | 'reply_text' => __( 'Reply', MUTHEME_NAME ) 88 | ) ) ) ?> 89 | 90 |
    91 | "> 94 | comment_parent; 96 | $comment_parent = get_comment( $parent_id ); 97 | printf( '%s', get_comment_author_link() ); 98 | ?> 99 | 100 | comment_date_gmt), true ); ?> 102 |
    103 | 108 |
    109 | 2 | 8 |

    9 | 10 |

    11 | 15 | 16 |
    17 | ( 18 | comment_count;?>)
    19 |
    20 |
      21 | 22 |
    23 | 33 |
    34 | 35 | comment_status ) : ?> 36 |

    37 | 38 | 39 | 40 |
    41 |
    42 |
    43 | 44 |
    45 | 46 |

    47 | login to reply.', MUTHEME_NAME ), wp_login_url( get_permalink() ) ); ?>

    48 | 49 | 50 |

    51 | %2$s back,', MUTHEME_NAME ), get_option( 'siteurl' ) . '/wp-admin/profile.php', $user_identity ); ?> 52 | 53 | 54 | 55 |

    56 | 57 | 58 |

    59 | 60 | %s.', $comment_author ) ?> 61 | 62 | 63 | 64 |

    65 |
    66 | 71 | 72 |
    73 | 74 |

    75 | 76 | 77 | 78 |

    79 |
    80 | 81 |
    82 | 83 |
    84 | 93 | 94 |
    95 | 96 |
    97 | 98 | ID ); ?> 99 | 100 |
    101 | 102 | 103 |
    -------------------------------------------------------------------------------- /public/js/all.js: -------------------------------------------------------------------------------- 1 | /*! Lazy Load 1.9.7 - MIT license - Copyright 2010-2015 Mika Tuupola */ 2 | !function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!1,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document); 3 | 4 | /*! 5 | * Bowser - a browser detector 6 | * https://github.com/ded/bowser 7 | * MIT License | (c) Dustin Diaz 2015 8 | */ 9 | 10 | ;(function(){window.bowser=function(b){function c(a){return(a=b.match(a))&&1a.version||a.chrome&&20>a.version||a.firefox&&20>a.version||a.safari&&6>a.version||a.opera&&10>a.version||a.ios&&a.osversion&&6>a.osversion.split(".")[0]?a.c=!0:a.x=!0;return a}("undefined"!== 17 | typeof window.navigator?window.navigator.userAgent:"")})(); 18 | 19 | jQuery(document).ready(function ($) { 20 | $('img.lazy,img.avatar').lazyload(); 21 | 22 | //if( bowser.mobile ){ 23 | //$('.mobile-menu-button').on('touchstart', function (event) { 24 | // $('body').hasClass('mobile-menu-open') ? $('body').removeClass('mobile-menu-open') : $('body').addClass('mobile-menu-open'); 25 | //}); 26 | $('.mobile-menu-button').on('click', function (event) { 27 | $('body').hasClass('mobile-menu-open') ? $('body').removeClass('mobile-menu-open') : $('body').addClass('mobile-menu-open'); 28 | }); 29 | //}else{ 30 | var hstatus = false, 31 | htimer; 32 | 33 | $('.dropdown').mouseenter(function (event) { 34 | var $this = $(this); 35 | 36 | if (htimer) { 37 | clearTimeout(htimer); 38 | htimer = null; 39 | } 40 | 41 | if (!$this.hasClass('selected')) { 42 | $this.addClass('selected'); 43 | hstatus = true; 44 | } 45 | }); 46 | 47 | $('.dropdown').mouseleave(function (event) { 48 | var $this = $(this); 49 | 50 | if ($this.hasClass('selected') && hstatus) { 51 | htimer = setTimeout(function () { 52 | $this.removeClass('selected'); 53 | hstatus = false; 54 | clearTimeout(htimer); 55 | htimer = null; 56 | }, 100); 57 | } 58 | }); 59 | //} 60 | 61 | 62 | }); -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | __( 'Top menu', MUTHEME_NAME ), 93 | 'global-menu' => __( 'Dropdown menu', MUTHEME_NAME ) 94 | ) ); 95 | } 96 | 97 | /** 98 | * Register sidebar 99 | */ 100 | if ( function_exists( 'register_sidebar' ) ) { 101 | register_sidebar( array( 102 | 'name' => 'sidebar', 103 | 'id' => 'sidebar-page', 104 | 'before_title' => '

    ', 105 | 'after_title' => '

    ' 106 | ) ); 107 | } 108 | 109 | /** 110 | * Register theme languages files 111 | */ 112 | load_theme_textdomain( MUTHEME_NAME, mutheme_path( 'languages' ) ); 113 | 114 | //替换Gavatar头像地址 115 | function get_ssl_avatar($avatar) { 116 | if (preg_match_all( 117 | '/(src|srcset)=["\']https?.*?\/avatar\/([^?]*)\?s=([\d]+)&([^"\']*)?["\']/i', 118 | $avatar, 119 | $matches 120 | ) > 0) { 121 | $url = 'https://secure.gravatar.com'; 122 | $size = $matches[3][0]; 123 | $vargs = array_pad(array(), count($matches[0]), array()); 124 | for ($i = 1; $i < count($matches); $i++) { 125 | for ($j = 0; $j < count($matches[$i]); $j++) { 126 | $tmp = strtolower($matches[$i][$j]); 127 | $vargs[$j][] = $tmp; 128 | if ($tmp == 'src') { 129 | $size = $matches[3][$j]; 130 | } 131 | } 132 | } 133 | $buffers = array(); 134 | foreach ($vargs as $varg) { 135 | $buffers[] = vsprintf( 136 | '%s="%s/avatar/%s?s=%s&%s"', 137 | array($varg[0], $url, $varg[1], $varg[2], $varg[3]) 138 | ); 139 | } 140 | return sprintf( 141 | 'avatar', 142 | implode(' ', $buffers), $size, $size, $size 143 | ); 144 | } else { 145 | return false; 146 | } 147 | } 148 | add_filter('get_avatar', 'get_ssl_avatar'); 149 | 150 | //禁止站内pingback 151 | function no_self_ping( &$links ) { 152 | $home = get_option( 'home' ); 153 | foreach ( $links as $l => $link ) 154 | if ( 0 === strpos( $link, $home ) ) unset($links[$l]); 155 | } 156 | add_action( 'pre_ping', 'no_self_ping' ); 157 | //移除预获取DNS 158 | function remove_dns_prefetch( $hints, $relation_type ) { 159 | if ( 'dns-prefetch' === $relation_type ) { 160 | return array_diff( wp_dependencies_unique_hosts(), $hints ); } return $hints; } 161 | add_filter( 'wp_resource_hints', 'remove_dns_prefetch', 10, 2 ); 162 | 163 | remove_action('admin_print_scripts','print_emoji_detection_script'); 164 | remove_action('admin_print_styles','print_emoji_styles'); 165 | remove_action('wp_head','print_emoji_detection_script', 7); 166 | remove_action('wp_print_styles','print_emoji_styles'); 167 | remove_action('embed_head','print_emoji_detection_script'); 168 | remove_filter('the_content_feed','wp_staticize_emoji'); 169 | remove_filter('comment_text_rss','wp_staticize_emoji'); 170 | remove_filter('wp_mail','wp_staticize_emoji_for_email'); 171 | remove_action( 'wp_head', 'feed_links', 2 ); //移除feed 172 | remove_action( 'wp_head', 'feed_links_extra', 3 ); //移除feed 173 | remove_action( 'wp_head', 'wp_generator' ); //移除WordPress版本 174 | add_filter( 'emoji_svg_url', '__return_false' ); //DNS EMOJI 175 | remove_action('rest_api_init', 'wp_oembed_register_route'); //EMbed 176 | remove_filter('rest_pre_serve_request', '_oembed_rest_pre_serve_request', 10, 4); 177 | remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10 ); 178 | remove_filter('oembed_response_data', 'get_oembed_response_data_rich', 10, 4); 179 | remove_action('wp_head', 'wp_oembed_add_discovery_links'); 180 | remove_action('wp_head', 'wp_oembed_add_host_js');//EMbed结束 181 | add_filter('xmlrpc_enabled', '__return_false'); 182 | // add_filter('use_block_editor_for_post', '__return_false');//禁用古腾堡 183 | // remove_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' );//禁用古腾堡前端 184 | 185 | add_action('admin_menu', function (){ 186 | global $menu, $submenu; 187 | // 移除设置菜单下的隐私子菜单。 188 | unset($submenu['options-general.php'][45]); 189 | // 移除工具菜单下的相关页面 190 | remove_action( 'admin_menu', '_wp_privacy_hook_requests_page' ); 191 | remove_filter( 'wp_privacy_personal_data_erasure_page', 'wp_privacy_process_personal_data_erasure_page', 10, 5 ); 192 | remove_filter( 'wp_privacy_personal_data_export_page', 'wp_privacy_process_personal_data_export_page', 10, 7 ); 193 | remove_filter( 'wp_privacy_personal_data_export_file', 'wp_privacy_generate_personal_data_export_file', 10 ); 194 | remove_filter( 'wp_privacy_personal_data_erased', '_wp_privacy_send_erasure_fulfillment_notification', 10 ); 195 | 196 | // Privacy policy text changes check. 197 | remove_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check' ), 100 ); 198 | 199 | // Show a "postbox" with the text suggestions for a privacy policy. 200 | remove_action( 'edit_form_after_title', array( 'WP_Privacy_Policy_Content', 'notice' ) ); 201 | 202 | // Add the suggested policy text from WordPress. 203 | remove_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 1 ); 204 | 205 | // Update the cached policy info when the policy page is updated. 206 | remove_action( 'post_updated', array( 'WP_Privacy_Policy_Content', '_policy_page_updated' ) ); 207 | },9); 208 | 209 | //复制出提示 210 | function zm_copyright_tips() { 211 | echo ''; 212 | } 213 | add_action( 'wp_footer', 'zm_copyright_tips', 100 ); 214 | //评论添加验证码 215 | function spam_protection_math(){ 216 | $num1=rand(0,9); 217 | $num2=rand(0,9); 218 | echo "\n "; 219 | echo "\n"; 220 | echo "\n"; 221 | echo ""; 222 | } 223 | function spam_protection_pre($commentdata){ 224 | $sum=$_POST['sum']; 225 | switch($sum){ 226 | case $_POST['num1']+$_POST['num2']: 227 | break; 228 | case null: 229 | wp_die('对不起: 请输入验证码。返回上一页','评论失败'); 230 | break; 231 | default: 232 | wp_die('对不起: 验证码错误,请返回重试。','评论失败'); 233 | } 234 | return $commentdata; 235 | } 236 | if($comment_data['comment_type']==''){ 237 | add_filter('preprocess_comment','spam_protection_pre'); 238 | } 239 | /** 240 | * 禁用emoji表情 241 | */ 242 | function disable_emojis() { 243 | remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); 244 | remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); 245 | remove_action( 'wp_print_styles', 'print_emoji_styles' ); 246 | remove_action( 'admin_print_styles', 'print_emoji_styles' ); 247 | remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); 248 | remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); 249 | remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); 250 | add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' ); 251 | } 252 | add_action( 'init', 'disable_emojis' ); 253 | /** 254 | * Filter function used to remove the tinymce emoji plugin. 255 | */ 256 | function disable_emojis_tinymce( $plugins ) { 257 | if ( is_array( $plugins ) ) { 258 | return array_diff( $plugins, array( 'wpemoji' ) ); 259 | } else { 260 | return array(); 261 | }} 262 | ?> -------------------------------------------------------------------------------- /languages/zh_CN.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Kunkka\n" 4 | "POT-Creation-Date: 2016-02-11 09:16+0800\n" 5 | "PO-Revision-Date: 2016-02-11 09:16+0800\n" 6 | "Last-Translator: \n" 7 | "Language-Team: mufeng \n" 8 | "Language: zh_CN\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=1; plural=0;\n" 13 | "X-Generator: Poedit 1.8.7\n" 14 | "X-Poedit-KeywordsList: __;_e\n" 15 | "X-Poedit-Basepath: ..\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "X-Poedit-SearchPath-0: .\n" 18 | 19 | #: 404.php:4 20 | msgid "The page not found or not this page" 21 | msgstr "页面出错或者不是当前页面" 22 | 23 | #: 404.php:5 24 | msgid "You can also try to search the post!" 25 | msgstr "你可以通过搜索来找到想要的文章!" 26 | 27 | #: archive.php:5 header.php:22 search.php:4 single.php:4 28 | msgid "Home" 29 | msgstr "首页" 30 | 31 | #: archive.php:9 32 | msgid "Category" 33 | msgstr "分类" 34 | 35 | #: archive.php:14 36 | msgid "Tag" 37 | msgstr "标签" 38 | 39 | #: archive.php:56 index.php:40 single.php:31 40 | msgid "0 reply" 41 | msgstr "0 回复" 42 | 43 | #: archive.php:56 index.php:40 single.php:31 44 | msgid "1 reply" 45 | msgstr "1 回复" 46 | 47 | #: archive.php:56 index.php:40 single.php:31 48 | msgid "% replies" 49 | msgstr "% 回复" 50 | 51 | #: comments.php:4 52 | msgid "Please don't directly loading the page, thanks!" 53 | msgstr "请不要直接加载该页面,谢谢!" 54 | 55 | #: comments.php:8 56 | msgid "This article requires a password, enter the password to access." 57 | msgstr "这篇文章需要密码,请输入密码访问。" 58 | 59 | #: comments.php:16 60 | msgid "Comments" 61 | msgstr "评论" 62 | 63 | #: comments.php:24 comments.php:33 64 | msgid "Comments Closed." 65 | msgstr "评论关闭。" 66 | 67 | #: comments.php:27 68 | msgid "Leave a reply" 69 | msgstr "发表评论" 70 | 71 | #: comments.php:41 72 | #, php-format 73 | msgid "You need login to reply." 74 | msgstr "你需要登录来评论." 75 | 76 | #: comments.php:44 77 | #, php-format 78 | msgid "Welcome %2$s back," 79 | msgstr "欢迎%2$s归来," 80 | 81 | #: comments.php:46 82 | msgid "Log out of this account" 83 | msgstr "退出帐号" 84 | 85 | #: comments.php:46 86 | msgid "Log out »" 87 | msgstr "退出 »" 88 | 89 | #: comments.php:50 90 | msgid "Welcome" 91 | msgstr "欢迎" 92 | 93 | #: comments.php:50 94 | msgid "back, " 95 | msgstr "归来, " 96 | 97 | #: comments.php:51 98 | msgid "Edit »" 99 | msgstr "编辑资料 »" 100 | 101 | #: comments.php:62 102 | msgid "Name" 103 | msgstr "昵称" 104 | 105 | #: comments.php:69 106 | msgid "Email" 107 | msgstr "邮箱" 108 | 109 | #: comments.php:76 110 | msgid "Website" 111 | msgstr "网址" 112 | 113 | #: comments.php:87 114 | msgid "Submit / Ctrl+Enter" 115 | msgstr "提交评论 / Ctrl+Enter" 116 | 117 | #: functions.php:91 118 | msgid "Top menu" 119 | msgstr "顶部菜单" 120 | 121 | #: functions.php:92 122 | msgid "Dropdown menu" 123 | msgstr "下拉菜单" 124 | 125 | #: functions/libraries/class.tgm.php:164 126 | msgid "Install Required Plugins" 127 | msgstr "" 128 | 129 | #: functions/libraries/class.tgm.php:165 130 | msgid "Install Plugins" 131 | msgstr "" 132 | 133 | #: functions/libraries/class.tgm.php:166 134 | #, php-format 135 | msgid "Installing Plugin: %s" 136 | msgstr "" 137 | 138 | #: functions/libraries/class.tgm.php:167 139 | msgid "Something went wrong." 140 | msgstr "" 141 | 142 | #: functions/libraries/class.tgm.php:178 functions/libraries/class.tgm.php:491 143 | msgid "Return to Required Plugins Installer" 144 | msgstr "" 145 | 146 | #: functions/libraries/class.tgm.php:179 functions/libraries/class.tgm.php:1847 147 | msgid "Plugin activated successfully." 148 | msgstr "" 149 | 150 | #: functions/libraries/class.tgm.php:180 151 | #, php-format 152 | msgid "All plugins installed and activated successfully. %1$s" 153 | msgstr "" 154 | 155 | #: functions/libraries/class.tgm.php:181 156 | msgid "Dismiss this notice." 157 | msgstr "" 158 | 159 | #: functions/libraries/class.tgm.php:518 functions/libraries/class.tgm.php:2059 160 | msgid "Return to the Dashboard" 161 | msgstr "" 162 | 163 | #: functions/libraries/class.tgm.php:546 164 | #, php-format 165 | msgid "The following plugin was activated successfully: %s." 166 | msgstr "" 167 | 168 | #: functions/libraries/class.tgm.php:1092 169 | msgid "External Link" 170 | msgstr "" 171 | 172 | #: functions/libraries/class.tgm.php:1097 173 | msgid "Private Repository" 174 | msgstr "" 175 | 176 | #: functions/libraries/class.tgm.php:1100 177 | msgid "Pre-Packaged" 178 | msgstr "" 179 | 180 | #: functions/libraries/class.tgm.php:1104 181 | msgid "WordPress Repository" 182 | msgstr "" 183 | 184 | #: functions/libraries/class.tgm.php:1107 185 | msgid "Required" 186 | msgstr "" 187 | 188 | #: functions/libraries/class.tgm.php:1107 189 | msgid "Recommended" 190 | msgstr "" 191 | 192 | #: functions/libraries/class.tgm.php:1110 193 | msgid "Not Installed" 194 | msgstr "" 195 | 196 | #: functions/libraries/class.tgm.php:1112 197 | msgid "Installed But Not Activated" 198 | msgstr "" 199 | 200 | #: functions/libraries/class.tgm.php:1282 201 | #, php-format 202 | msgid "" 203 | "No plugins to install or activate. Return to the Dashboard" 205 | msgstr "" 206 | 207 | #: functions/libraries/class.tgm.php:1298 208 | msgid "Plugin" 209 | msgstr "" 210 | 211 | #: functions/libraries/class.tgm.php:1299 212 | msgid "Source" 213 | msgstr "" 214 | 215 | #: functions/libraries/class.tgm.php:1300 216 | msgid "Type" 217 | msgstr "" 218 | 219 | #: functions/libraries/class.tgm.php:1301 220 | msgid "Status" 221 | msgstr "" 222 | 223 | #: functions/libraries/class.tgm.php:1319 224 | msgid "Install" 225 | msgstr "" 226 | 227 | #: functions/libraries/class.tgm.php:1320 228 | msgid "Activate" 229 | msgstr "" 230 | 231 | #: functions/libraries/class.tgm.php:1830 232 | msgid "Install package not available." 233 | msgstr "" 234 | 235 | #: functions/libraries/class.tgm.php:1831 236 | #, php-format 237 | msgid "Downloading install package from %s…" 238 | msgstr "" 239 | 240 | #: functions/libraries/class.tgm.php:1832 241 | msgid "Unpacking the package…" 242 | msgstr "" 243 | 244 | #: functions/libraries/class.tgm.php:1833 245 | msgid "Installing the plugin…" 246 | msgstr "" 247 | 248 | #: functions/libraries/class.tgm.php:1834 249 | msgid "Plugin install failed." 250 | msgstr "" 251 | 252 | #: functions/libraries/class.tgm.php:1835 253 | msgid "Plugin installed successfully." 254 | msgstr "" 255 | 256 | #: functions/libraries/class.tgm.php:1846 257 | msgid "Plugin activation failed." 258 | msgstr "" 259 | 260 | #: functions/libraries/class.tgm.php:1956 261 | msgid "" 262 | "The installation and activation process is starting. This process may take a " 263 | "while on some hosts, so please be patient." 264 | msgstr "" 265 | 266 | #: functions/libraries/class.tgm.php:1957 267 | #, php-format 268 | msgid "%1$s installed and activated successfully." 269 | msgstr "" 270 | 271 | #: functions/libraries/class.tgm.php:1957 272 | #: functions/libraries/class.tgm.php:1966 273 | msgid "Show Details" 274 | msgstr "" 275 | 276 | #: functions/libraries/class.tgm.php:1957 277 | #: functions/libraries/class.tgm.php:1966 278 | msgid "Hide Details" 279 | msgstr "" 280 | 281 | #: functions/libraries/class.tgm.php:1958 282 | msgid "All installations and activations have been completed." 283 | msgstr "" 284 | 285 | #: functions/libraries/class.tgm.php:1959 286 | #, php-format 287 | msgid "Installing and Activating Plugin %1$s (%2$d/%3$d)" 288 | msgstr "" 289 | 290 | #: functions/libraries/class.tgm.php:1963 291 | msgid "" 292 | "The installation process is starting. This process may take a while on some " 293 | "hosts, so please be patient." 294 | msgstr "" 295 | 296 | #: functions/libraries/class.tgm.php:1964 297 | #, php-format 298 | msgid "An error occurred while installing %1$s: %2$s." 299 | msgstr "" 300 | 301 | #: functions/libraries/class.tgm.php:1965 302 | #, php-format 303 | msgid "The installation of %1$s failed." 304 | msgstr "" 305 | 306 | #: functions/libraries/class.tgm.php:1966 307 | #, php-format 308 | msgid "%1$s installed successfully." 309 | msgstr "" 310 | 311 | #: functions/libraries/class.tgm.php:1967 312 | msgid "All installations have been completed." 313 | msgstr "" 314 | 315 | #: functions/libraries/class.tgm.php:1968 316 | #, php-format 317 | msgid "Installing Plugin %1$s (%2$d/%3$d)" 318 | msgstr "" 319 | 320 | #: functions/mutheme-basic.php:18 321 | msgid "Search"" 322 | msgstr "" 323 | 324 | #: functions/mutheme-basic.php:195 325 | msgid " days ago" 326 | msgstr " 天前" 327 | 328 | #: functions/mutheme-basic.php:196 329 | msgid " hours ago" 330 | msgstr " 小时前" 331 | 332 | #: functions/mutheme-basic.php:197 333 | msgid " minutes ago" 334 | msgstr " 分钟前" 335 | 336 | #: functions/mutheme-basic.php:198 337 | msgid " seconds ago" 338 | msgstr " 秒前" 339 | 340 | #: functions/mutheme-basic.php:228 341 | msgid " views" 342 | msgstr " 阅读" 343 | 344 | #: functions/mutheme-function.php:52 345 | msgid "Sofa" 346 | msgstr "沙发" 347 | 348 | #: functions/mutheme-function.php:55 349 | msgid "Bench" 350 | msgstr "板凳" 351 | 352 | #: functions/mutheme-function.php:58 353 | msgid "Floor" 354 | msgstr "地板" 355 | 356 | #: functions/mutheme-function.php:61 357 | #, php-format 358 | msgid "%s Floor" 359 | msgstr "%s 楼" 360 | 361 | #: functions/mutheme-function.php:75 functions/mutheme-function.php:87 362 | msgid "Reply" 363 | msgstr "回复" 364 | 365 | #: functions/mutheme-settings.php:176 366 | msgid "Save Changes" 367 | msgstr "保存设置" 368 | 369 | #: functions/mutheme-settings.php:329 370 | msgid "安装推荐插件" 371 | msgstr "" 372 | 373 | #: functions/mutheme-settings.php:330 374 | msgid "安装插件" 375 | msgstr "" 376 | 377 | #: functions/mutheme-settings.php:331 378 | #, php-format 379 | msgid "正在安装插件: %s" 380 | msgstr "" 381 | 382 | #: functions/mutheme-settings.php:333 383 | msgid "出错了." 384 | msgstr "" 385 | 386 | #: functions/mutheme-settings.php:352 387 | msgid "继续安装推荐插件。" 388 | msgstr "" 389 | 390 | #: functions/mutheme-settings.php:353 391 | msgid "成功开启插件。" 392 | msgstr "" 393 | 394 | #: functions/mutheme-settings.php:354 395 | #, php-format 396 | msgid "所有插件已成功安装并开启 %s。" 397 | msgstr "" 398 | 399 | #: functions/mutheme-widget.php:23 400 | msgid "Popular posts" 401 | msgstr "热门文章" 402 | 403 | #: functions/mutheme-widget.php:98 404 | msgid "Last modified posts" 405 | msgstr "最近更新文章" 406 | 407 | #: functions/mutheme-widget.php:118 408 | msgid "Update time:" 409 | msgstr "更新时间:" 410 | 411 | #: functions/mutheme-widget.php:174 412 | msgid "Latest comments" 413 | msgstr "最新评论" 414 | 415 | #: functions/mutheme-widget.php:245 416 | msgid "Links" 417 | msgstr "友情链接" 418 | 419 | #: header.php:30 420 | msgid "Navigation" 421 | msgstr "导航" 422 | 423 | #: header.php:40 424 | msgid "Categories" 425 | msgstr "分类" 426 | 427 | #: header.php:50 428 | msgid "Pages" 429 | msgstr "页面" 430 | 431 | #: header.php:59 432 | msgid "Tags" 433 | msgstr "标签" 434 | 435 | #: header.php:89 search.php:5 436 | msgid "Search keyword" 437 | msgstr "搜索关键词" 438 | 439 | #: index.php:20 440 | msgid "Stick" 441 | msgstr "置顶" 442 | 443 | #: sidebar.php:3 444 | msgid "Please set up widgets at dashboard!" 445 | msgstr "请在后台设置小工具!" 446 | 447 | #~ msgid "Nickname" 448 | #~ msgstr "昵称" 449 | 450 | #~ msgid "The page fault or not this page" 451 | #~ msgstr "页面出错或者没有此页面" 452 | 453 | #~ msgid "" 454 | #~ "You can also try to through the top of the search to find what you want " 455 | #~ "to see" 456 | #~ msgstr "你也可以试着通过上方的搜索找到你想要看到的文章!" 457 | -------------------------------------------------------------------------------- /functions/mutheme-widget.php: -------------------------------------------------------------------------------- 1 | 'Kunkka:热门文章(需要WP-PostViews插件)' ); 14 | $this->WP_Widget( 'Mutheme_widget_populars', 'Kunkka:热门文章', $widget_ops ); 15 | } 16 | 17 | function widget( $args, $instance ) { 18 | extract( $args ); 19 | $limit = strip_tags( $instance['limit'] ); 20 | $limit = $limit ? $limit : 10; 21 | ?> 22 |
    23 |

    24 |
      25 | 1, 28 | 'meta_key' => 'views', 29 | 'orderby' => 'meta_value_num', 30 | 'ignore_sticky_posts' => 1, 31 | 'post_type' => 'post', 32 | 'post_status' => 'publish', 33 | 'showposts' => $limit 34 | ); 35 | $posts = query_posts( $args ); ?> 36 | 37 | 46 | 50 |
    51 |
    52 | '' ) ); 68 | $limit = strip_tags( $instance['limit'] ); 69 | ?> 70 | 71 |

    75 | 77 | 'Kunkka:最近更新的文章' ); 89 | $this->WP_Widget( 'Mutheme_widget_modified', 'Kunkka:最近更新', $widget_ops ); 90 | } 91 | 92 | function widget( $args, $instance ) { 93 | extract( $args ); 94 | $limit = strip_tags( $instance['limit'] ); 95 | $limit = $limit ? $limit : 8; 96 | ?> 97 |
    98 |

    99 |
      100 | 'modified', 103 | 'ignore_sticky_posts' => 1, 104 | 'post_type' => 'post', 105 | 'post_status' => 'publish', 106 | 'showposts' => $limit 107 | ); 108 | $index = 0; 109 | $posts = query_posts( $args ); ?> 110 | 111 |
    • 112 |

      113 | 115 |

      116 | 117 |

      118 | 119 | post_modified_gmt)); ?> 120 |

      121 |
    • 122 | 126 |
    127 |
    128 | '' ) ); 144 | $limit = strip_tags( $instance['limit'] ); 145 | ?> 146 | 147 |

    151 | 153 | 'Kunkka:最新评论' ); 165 | $this->WP_Widget( 'Mutheme_widget_comment', 'Kunkka:最新评论', $widget_ops ); 166 | } 167 | 168 | function widget( $args, $instance ) { 169 | extract( $args ); 170 | $limit = strip_tags( $instance['limit'] ); 171 | $limit = $limit ? $limit : 5; 172 | ?> 173 |
    174 |

    175 |
      176 | 179 |
    • 180 |

      181 | 182 | comment_content; ?> 183 | 184 |

      185 | 186 |

      187 | comment_author_email, 32 ); ?> 188 | comment_author; ?> 189 | comment_date_gmt)); ?> 190 |

      191 |
    • 192 | 195 |
    196 |
    197 | '' ) ); 213 | $limit = strip_tags( $instance['limit'] ); 214 | ?> 215 | 216 |

    220 | 222 | 'Kunkka:友情链接' ); 234 | $this->WP_Widget( 'Mutheme_widget_links', 'Kunkka:友情链接', $widget_ops ); 235 | } 236 | 237 | function widget( $args, $instance ) { 238 | extract( $args ); 239 | $limit = strip_tags( $instance['limit'] ); 240 | $limit = $limit ? $limit : 10; 241 | ?> 242 | 257 | '' ) ); 272 | $limit = strip_tags( $instance['limit'] ); 273 | ?> 274 | 275 |

    279 | 281 | metadataUrl = $metadataUrl; 39 | $this->enableAutomaticChecking = $enableAutomaticChecking; 40 | $this->theme = $theme; 41 | $this->optionName = 'external_theme_updates-'.$this->theme; 42 | 43 | $this->installHooks(); 44 | } 45 | 46 | /** 47 | * Install the hooks required to run periodic update checks and inject update info 48 | * into WP data structures. 49 | * 50 | * @return void 51 | */ 52 | public function installHooks(){ 53 | //Check for updates when WordPress does. We can detect when that happens by tracking 54 | //updates to the "update_themes" transient, which only happen in wp_update_themes(). 55 | if ( $this->enableAutomaticChecking ){ 56 | add_filter('pre_set_site_transient_update_themes', array($this, 'onTransientUpdate')); 57 | } 58 | 59 | //Insert our update info into the update list maintained by WP. 60 | add_filter('site_transient_update_themes', array($this,'injectUpdate')); 61 | 62 | //Delete our update info when WP deletes its own. 63 | //This usually happens when a theme is installed, removed or upgraded. 64 | add_action('delete_site_transient_update_themes', array($this, 'deleteStoredData')); 65 | } 66 | 67 | /** 68 | * Retrieve update info from the configured metadata URL. 69 | * 70 | * Returns either an instance of ThemeUpdate, or NULL if there is 71 | * no newer version available or if there's an error. 72 | * 73 | * @uses wp_remote_get() 74 | * 75 | * @param array $queryArgs Additional query arguments to append to the request. Optional. 76 | * @return ThemeUpdate 77 | */ 78 | public function requestUpdate($queryArgs = array()){ 79 | //Query args to append to the URL. Themes can add their own by using a filter callback (see addQueryArgFilter()). 80 | $queryArgs['theme'] = $this->theme; 81 | $queryArgs['installed_version'] = $this->getInstalledVersion(); 82 | $queryArgs = apply_filters(self::$filterPrefix.'query_args-'.$this->theme, $queryArgs); 83 | 84 | //Various options for the wp_remote_get() call. Themes can filter these, too. 85 | $options = array( 86 | 'timeout' => 10, //seconds 87 | ); 88 | $options = apply_filters(self::$filterPrefix.'options-'.$this->theme, $options); 89 | 90 | $url = $this->metadataUrl; 91 | if ( !empty($queryArgs) ){ 92 | $url = add_query_arg($queryArgs, $url); 93 | } 94 | 95 | //Send the request. 96 | $result = wp_remote_get($url, $options); 97 | 98 | //Try to parse the response 99 | $themeUpdate = null; 100 | $code = wp_remote_retrieve_response_code($result); 101 | $body = wp_remote_retrieve_body($result); 102 | if ( ($code == 200) && !empty($body) ){ 103 | $themeUpdate = ThemeUpdate::fromJson($body); 104 | //The update should be newer than the currently installed version. 105 | if ( ($themeUpdate != null) && version_compare($themeUpdate->version, $this->getInstalledVersion(), '<=') ){ 106 | $themeUpdate = null; 107 | } 108 | } 109 | 110 | $themeUpdate = apply_filters(self::$filterPrefix.'result-'.$this->theme, $themeUpdate, $result); 111 | return $themeUpdate; 112 | } 113 | 114 | /** 115 | * Get the currently installed version of our theme. 116 | * 117 | * @return string Version number. 118 | */ 119 | public function getInstalledVersion(){ 120 | if ( function_exists('wp_get_theme') ) { 121 | $theme = wp_get_theme($this->theme); 122 | return $theme->get('Version'); 123 | } 124 | 125 | /** @noinspection PhpDeprecationInspection get_themes() used for compatibility with WP 3.3 and below. */ 126 | foreach(get_themes() as $theme){ 127 | if ( $theme['Stylesheet'] === $this->theme ){ 128 | return $theme['Version']; 129 | } 130 | } 131 | return ''; 132 | } 133 | 134 | /** 135 | * Check for theme updates. 136 | * 137 | * @return void 138 | */ 139 | public function checkForUpdates(){ 140 | $state = get_option($this->optionName); 141 | if ( empty($state) ){ 142 | $state = new StdClass; 143 | $state->lastCheck = 0; 144 | $state->checkedVersion = ''; 145 | $state->update = null; 146 | } 147 | 148 | $state->lastCheck = time(); 149 | $state->checkedVersion = $this->getInstalledVersion(); 150 | update_option($this->optionName, $state); //Save before checking in case something goes wrong 151 | 152 | $update = $this->requestUpdate(); 153 | $state->update = ($update instanceof ThemeUpdate) ? $update->toJson() : $update; 154 | update_option($this->optionName, $state); 155 | } 156 | 157 | /** 158 | * Run the automatic update check, but no more than once per page load. 159 | * This is a callback for WP hooks. Do not call it directly. 160 | * 161 | * @param mixed $value 162 | * @return mixed 163 | */ 164 | public function onTransientUpdate($value){ 165 | if ( !$this->automaticCheckDone ){ 166 | $this->checkForUpdates(); 167 | $this->automaticCheckDone = true; 168 | } 169 | return $value; 170 | } 171 | 172 | /** 173 | * Insert the latest update (if any) into the update list maintained by WP. 174 | * 175 | * @param StdClass $updates Update list. 176 | * @return array Modified update list. 177 | */ 178 | public function injectUpdate($updates){ 179 | $state = get_option($this->optionName); 180 | 181 | //Is there an update to insert? 182 | if ( !empty($state) && isset($state->update) && !empty($state->update) ){ 183 | $update = $state->update; 184 | if ( is_string($state->update) ) { 185 | $update = ThemeUpdate::fromJson($state->update); 186 | } 187 | $updates->response[$this->theme] = $update->toWpFormat(); 188 | } 189 | 190 | return $updates; 191 | } 192 | 193 | /** 194 | * Delete any stored book-keeping data. 195 | * 196 | * @return void 197 | */ 198 | public function deleteStoredData(){ 199 | delete_option($this->optionName); 200 | } 201 | 202 | /** 203 | * Register a callback for filtering query arguments. 204 | * 205 | * The callback function should take one argument - an associative array of query arguments. 206 | * It should return a modified array of query arguments. 207 | * 208 | * @param callable $callback 209 | * @return void 210 | */ 211 | public function addQueryArgFilter($callback){ 212 | add_filter(self::$filterPrefix.'query_args-'.$this->theme, $callback); 213 | } 214 | 215 | /** 216 | * Register a callback for filtering arguments passed to wp_remote_get(). 217 | * 218 | * The callback function should take one argument - an associative array of arguments - 219 | * and return a modified array or arguments. See the WP documentation on wp_remote_get() 220 | * for details on what arguments are available and how they work. 221 | * 222 | * @param callable $callback 223 | * @return void 224 | */ 225 | public function addHttpRequestArgFilter($callback){ 226 | add_filter(self::$filterPrefix.'options-'.$this->theme, $callback); 227 | } 228 | 229 | /** 230 | * Register a callback for filtering the theme info retrieved from the external API. 231 | * 232 | * The callback function should take two arguments. If a theme update was retrieved 233 | * successfully, the first argument passed will be an instance of ThemeUpdate. Otherwise, 234 | * it will be NULL. The second argument will be the corresponding return value of 235 | * wp_remote_get (see WP docs for details). 236 | * 237 | * The callback function should return a new or modified instance of ThemeUpdate or NULL. 238 | * 239 | * @param callable $callback 240 | * @return void 241 | */ 242 | public function addResultFilter($callback){ 243 | add_filter(self::$filterPrefix.'result-'.$this->theme, $callback, 10, 2); 244 | } 245 | } 246 | 247 | endif; 248 | 249 | if ( !class_exists('ThemeUpdate') ): 250 | 251 | /** 252 | * A simple container class for holding information about an available update. 253 | * 254 | * @author Janis Elsts 255 | * @copyright 2012 256 | * @version 1.1 257 | * @access public 258 | */ 259 | class ThemeUpdate { 260 | public $version; //Version number. 261 | public $details_url; //The URL where the user can learn more about this version. 262 | public $download_url; //The download URL for this version of the theme. Optional. 263 | 264 | /** 265 | * Create a new instance of ThemeUpdate from its JSON-encoded representation. 266 | * 267 | * @param string $json Valid JSON string representing a theme information object. 268 | * @return ThemeUpdate New instance of ThemeUpdate, or NULL on error. 269 | */ 270 | public static function fromJson($json){ 271 | $apiResponse = json_decode($json); 272 | if ( empty($apiResponse) || !is_object($apiResponse) ){ 273 | return null; 274 | } 275 | 276 | //Very, very basic validation. 277 | $valid = isset($apiResponse->version) && !empty($apiResponse->version) && isset($apiResponse->details_url) && !empty($apiResponse->details_url); 278 | if ( !$valid ){ 279 | return null; 280 | } 281 | 282 | $update = new self(); 283 | foreach(get_object_vars($apiResponse) as $key => $value){ 284 | $update->$key = $value; 285 | } 286 | 287 | return $update; 288 | } 289 | 290 | /** 291 | * Serialize update information as JSON. 292 | * 293 | * @return string 294 | */ 295 | public function toJson() { 296 | return json_encode($this); 297 | } 298 | 299 | /** 300 | * Transform the update into the format expected by the WordPress core. 301 | * 302 | * @return array 303 | */ 304 | public function toWpFormat(){ 305 | $update = array( 306 | 'new_version' => $this->version, 307 | 'url' => $this->details_url, 308 | ); 309 | 310 | if ( !empty($this->download_url) ){ 311 | $update['package'] = $this->download_url; 312 | } 313 | 314 | return $update; 315 | } 316 | } 317 | 318 | endif; 319 | -------------------------------------------------------------------------------- /functions/mutheme-basic.php: -------------------------------------------------------------------------------- 1 | 16 | <?php bloginfo( 'name' ); ?> - <?php bloginfo( 'description' ); ?> 17 | <?php _e( 'Search"', MUTHEME_NAME );the_search_query();echo """; ?> - <?php bloginfo( 'name' ); ?> 18 | <?php echo trim( wp_title( '', 0 ) ); ?> - <?php bloginfo( 'name' ); ?> 19 | <?php wp_title( "" ); ?> - <?php bloginfo( 'name' ); ?> 20 | <?php single_cat_title(); ?> - <?php bloginfo( 'name' ); ?> 21 | <?php the_time( 'Y' ); ?> - <?php bloginfo( 'name' ); ?> 22 | <?php the_time( 'F' ); ?> - <?php bloginfo( 'name' ); ?> 23 | <?php echo trim( wp_title( '', 0 ) ); ?> - <?php bloginfo( 'name' ); ?> 24 | 404 - <?php bloginfo( 'name' ); ?> 25 | ID, "keywords", true ); 32 | if ( $keywords == "" ) { 33 | $tags = wp_get_post_tags( $post->ID ); 34 | foreach ( $tags as $tag ) { 35 | $keywords = $keywords . $tag->name . ","; 36 | } 37 | $keywords = rtrim( $keywords, ', ' ); 38 | } 39 | $description = get_post_meta( $post->ID, "description", true ); 40 | if ( $description == "" ) { 41 | if ( $post->post_excerpt ) { 42 | $description = $post->post_excerpt; 43 | } else { 44 | $description = mutheme_excerpt( $post->post_content, 200 ); 45 | } 46 | } 47 | } elseif ( is_page() ) { 48 | $keywords = get_post_meta( $post->ID, "keywords", true ); 49 | $description = get_post_meta( $post->ID, "description", true ); 50 | } elseif ( is_category() ) { 51 | $keywords = single_cat_title( '', false ); 52 | $description = category_description(); 53 | } elseif ( is_tag() ) { 54 | $keywords = single_tag_title( '', false ); 55 | $description = tag_description(); 56 | } 57 | $keywords = trim( strip_tags( $keywords ) ); 58 | $description = trim( strip_tags( $description ) ); 59 | ?> 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 'default', 80 | 'description' => '', 81 | 'keywords' => '', 82 | 'tag_number' => 25, 83 | 'avatar' => 1, 84 | 'cdn' => 0, 85 | 'thumbnail' => 0, 86 | 'register_widget' => 0, 87 | 'fixed_navigation' => 0, 88 | 'full-content' => 0, 89 | 'disable_global_navigation' => 0 90 | ); 91 | 92 | $settings = get_option( MUTHEME_NAME . '_settings' ); 93 | $settings = wp_parse_args( $settings, $defaults ); 94 | 95 | return $settings[ $key ]; 96 | } 97 | 98 | /** 99 | * Theme file path 100 | * 101 | * @param $path 102 | * 103 | * @return string 104 | */ 105 | function mutheme_path( $path ) { 106 | $file_path = MUTHEME_PATH . '/' . $path; 107 | 108 | return $file_path; 109 | } 110 | 111 | /** 112 | * Theme file url 113 | * 114 | * @param $file_path 115 | * 116 | * @return string 117 | */ 118 | function mutheme_file_url( $file_path ) { 119 | $file_path = MUTHEME_THEME_URL . '/' . $file_path; 120 | 121 | return $file_path; 122 | } 123 | 124 | /** 125 | * Theme css style url 126 | * 127 | * @param string $style_name 128 | * 129 | * @return string 130 | */ 131 | function mutheme_style( $style_name ) { 132 | $style_url = mutheme_file_url( 'public/css/' . $style_name ); 133 | 134 | return $style_url; 135 | } 136 | 137 | /** 138 | * Theme javascript files url 139 | * 140 | * @param string $script_name 141 | * 142 | * @return string 143 | */ 144 | function mutheme_script( $script_name ) { 145 | $script_url = mutheme_file_url( 'public/js/' . $script_name ); 146 | 147 | return $script_url; 148 | } 149 | 150 | /** 151 | * Theme image files url 152 | * 153 | * @param string $image_name 154 | * 155 | * @return string 156 | */ 157 | function mutheme_image( $image_name ) { 158 | $image_url = mutheme_file_url( 'public/images/' . $image_name ); 159 | 160 | return $image_url; 161 | } 162 | 163 | /** 164 | * Post excerpt 165 | * 166 | * @param string $content 167 | * @param int $limit 168 | * 169 | * @return string 170 | */ 171 | function mutheme_excerpt( $content, $limit = 100 ) { 172 | if ( $content ) { 173 | $content = preg_replace( "/\[.*?\].*?\[\/.*?\]/is", "", $content ); 174 | $content = mb_strimwidth( strip_tags( apply_filters( 'the_content', $content ) ), 0, $limit, "..." ); 175 | } 176 | 177 | return strip_tags( $content ); 178 | } 179 | 180 | /** 181 | * Like weibo time style 182 | * 183 | * @param string $older_date 184 | * @param bool $comment_date 185 | * 186 | * @return string 187 | */ 188 | function mutheme_time_since( $older_date, $comment_date = false ) { 189 | $chunks = array( 190 | array( 24 * 60 * 60, __( ' days ago', MUTHEME_NAME ) ), 191 | array( 60 * 60, __( ' hours ago', MUTHEME_NAME ) ), 192 | array( 60, __( ' minutes ago', MUTHEME_NAME ) ), 193 | array( 1, __( ' seconds ago', MUTHEME_NAME ) ) 194 | ); 195 | 196 | $newer_date = time(); 197 | $since = abs( $newer_date - $older_date ); 198 | 199 | if ( $since < 30 * 24 * 60 * 60 ) { 200 | for ( $i = 0, $j = count( $chunks ); $i < $j; $i ++ ) { 201 | $seconds = $chunks[ $i ][0]; 202 | $name = $chunks[ $i ][1]; 203 | if ( ( $count = floor( $since / $seconds ) ) != 0 ) { 204 | break; 205 | } 206 | } 207 | $output = $count . $name; 208 | } else { 209 | $output = $comment_date ? date( 'Y-m-d H:i', $older_date ) : date( 'Y-m-d', $older_date ); 210 | } 211 | 212 | return $output; 213 | } 214 | 215 | /** 216 | * Post views 217 | */ 218 | function mutheme_views() { 219 | if ( function_exists( 'the_views' ) ) { 220 | global $post; 221 | ?> 222 |
  • ·
  • 223 |
  • 224 | ID; 240 | } 241 | 242 | $post_views = get_post_meta( $post_id, 'views', true ); 243 | 244 | if ( $post_views > 1000 ) { 245 | $post_views = sprintf( "%.2fk", $post_views / 1000 ); 246 | } 247 | 248 | return $post_views; 249 | } 250 | 251 | /** 252 | * Post like 253 | */ 254 | function mutheme_likes() { 255 | if ( function_exists( 'wp_zan' ) ) { 256 | ?> 257 |
  • ·
  • 258 |
  • 259 | false, 277 | 'url' => null, 278 | 'size' => array( $width, $height ), 279 | 'crop' => true 280 | ); 281 | 282 | $size_array = array( 283 | 'full' => array( $width, $height ), 284 | 'index-thumbnail' => array( 260, 260 ) 285 | ); 286 | 287 | if ( has_post_thumbnail() ) { 288 | $attachment_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $type ); 289 | 290 | $result['exist'] = true; 291 | $result['url'] = $attachment_image[0]; 292 | 293 | // correct image size that don't need crop 294 | if ( $size_array[ $type ][0] == $attachment_image[1] && $size_array[ $type ][1] == $attachment_image[2] ) { 295 | $result['crop'] = false; 296 | } 297 | 298 | } else if ( ! mutheme_settings( 'thumbnail' ) ) { 299 | ob_start(); 300 | ob_end_clean(); 301 | 302 | //filter all the images in the post content 303 | preg_match_all( '/\/is', $post->post_content, $matches, PREG_SET_ORDER ); 304 | $count = count( $matches ); 305 | 306 | if ( $count > 0 ) { 307 | $result['exist'] = true; 308 | $result['url'] = $matches[0][1]; 309 | } 310 | } 311 | 312 | return $result; 313 | } 314 | 315 | /** 316 | * Theme file cdn setting 317 | * 318 | * @param array|string $obj 319 | * @param int $width 320 | * @param int $height 321 | * @param bool $is_avatar 322 | * 323 | * @return string 324 | */ 325 | function mutheme_cdn( $obj, $width = 0, $height = 0, $is_avatar = false ) { 326 | $url = ''; 327 | $need_crop = true; 328 | $cdn_type = mutheme_settings( 'cdn' ); 329 | 330 | if ( is_array( $obj ) ) { 331 | $url = $obj['url']; 332 | $width = $obj['size'][0]; 333 | $height = $obj['size'][1]; 334 | $need_crop = $obj['crop']; 335 | } else if ( is_string( $obj ) ) { 336 | $url = $obj; 337 | } 338 | 339 | if ( $cdn_type == 0 ) { 340 | //don't use any cdn services 341 | if ( $need_crop && !$is_avatar) { 342 | $url = sprintf( '%s?src=%s&w=%s&h=%s&zc=1&q=100', mutheme_file_url( 'timthumb.php' ), urlencode( $url ), $width, $height ); 343 | } 344 | 345 | } else if ( $cdn_type == 1 ) { 346 | //qiniu cdn service 347 | $url .= "?imageView/1/w/{$width}/h/{$height}/q/100"; 348 | 349 | } else if ( $cdn_type == 2 ) { 350 | //youpai cdn service 351 | $url .= "!{$width}x{$height}"; 352 | 353 | } 354 | 355 | return $url; 356 | } 357 | 358 | /** 359 | * Theme pagenavi 360 | * 361 | * @param int $space 362 | */ 363 | function mutheme_pagenavi( $space = 5 ) { 364 | if ( is_singular() ) { 365 | return; 366 | } 367 | 368 | global $wp_query, $paged; 369 | $max_page = $wp_query->max_num_pages; 370 | 371 | if ( $max_page == 1 ) { 372 | return; 373 | } 374 | if ( empty( $paged ) ) { 375 | $paged = 1; 376 | } 377 | 378 | if ( $paged > 1 ) { 379 | printf( '%s', esc_html( get_pagenum_link( $paged - 1 ) ), '« Previous', '«' ); 380 | } 381 | if ( $paged > $space + 2 ) { 382 | echo '...'; 383 | } 384 | for ( $i = $paged - $space; $i <= $paged + $space; $i ++ ) { 385 | if ( $i > 0 && $i <= $max_page ) { 386 | if ( $i == $paged ) { 387 | echo "{$i}"; 388 | } else { 389 | printf( '%s', esc_html( get_pagenum_link( $i ) ), $i, $i ); 390 | } 391 | } 392 | } 393 | if ( $paged < $max_page - $space - 1 ) { 394 | echo '...'; 395 | } 396 | if ( $paged < $max_page ) { 397 | printf( '%s', esc_html( get_pagenum_link( $paged + 1 ) ), 'Next »', '»' ); 398 | } 399 | } -------------------------------------------------------------------------------- /functions/mutheme-settings.php: -------------------------------------------------------------------------------- 1 | defaults = array( 16 | array( 17 | 'title' => '主题配色', 18 | 'key' => 'color', 19 | 'type' => 'radio', 20 | 'value' => array( 21 | 'default' => '默认', 22 | 'red' => '新年红', 23 | 'blue' => '理工蓝', 24 | 'green' => '青葱绿' 25 | ), 26 | 'label' => false 27 | ), 28 | array( 29 | 'title' => '网站描述', 30 | 'key' => 'description', 31 | 'type' => 'textarea', 32 | 'value' => false, 33 | 'label' => '用简洁凝练的话对你的网站进行描述' 34 | ), 35 | array( 36 | 'title' => '网站关键词', 37 | 'key' => 'keywords', 38 | 'type' => 'textarea', 39 | 'value' => false, 40 | 'label' => '多个关键词请用英文逗号隔开' 41 | ), 42 | array( 43 | 'title' => '导航标签数量', 44 | 'key' => 'tag_number', 45 | 'type' => 'number', 46 | 'value' => false, 47 | 'label' => '默认标签数量为25,标签使用文章数量排序' 48 | ), 49 | array( 50 | 'title' => 'CDN设置', 51 | 'key' => 'cdn', 52 | 'type' => 'radio', 53 | 'value' => array( 54 | 0 => '不使用', 55 | 1 => '七牛', 56 | 2 => '又拍' 57 | ), 58 | 'label' => '七牛用户勾选即可,又拍用户需要新建规则: !260x260' 59 | ), 60 | array( 61 | 'title' => '头像来源', 62 | 'key' => 'avatar', 63 | 'type' => 'radio', 64 | 'value' => array( 65 | 0 => '默认', 66 | 1 => '多说' 67 | ), 68 | 'label' => false 69 | ), 70 | /*array( 71 | 'title' => '导航栏', 72 | 'key' => 'fixed_navigation', 73 | 'type' => 'checkbox', 74 | 'value' => 1, 75 | 'text' => '固定头部导航栏', 76 | 'label' => '勾选后,导航栏将会固定在头部' 77 | ),*/ 78 | array( 79 | 'title' => '导航菜单', 80 | 'key' => 'disable_global_navigation', 81 | 'type' => 'checkbox', 82 | 'value' => 1, 83 | 'text' => '禁用导航菜单', 84 | 'label' => '勾选后,禁止使用下拉导航菜单' 85 | ), 86 | array( 87 | 'title' => '缩略图', 88 | 'key' => 'thumbnail', 89 | 'type' => 'checkbox', 90 | 'value' => 1, 91 | 'text' => '只显示特色图片', 92 | 'label' => '勾选后,首页和归档页面只显示特色图片的缩略图,文章中插入的图片缩略图将不会显示' 93 | ), 94 | array( 95 | 'title' => '默认小工具', 96 | 'key' => 'register_widget', 97 | 'type' => 'checkbox', 98 | 'value' => 1, 99 | 'text' => '开启默认小工具', 100 | 'label' => '默认禁用 Wordpress 自带的小工具, 勾选后,开启默认小工具' 101 | ), 102 | array( 103 | 'title' => '首页、分类内容', 104 | 'key' => 'full-content', 105 | 'type' => 'checkbox', 106 | 'value' => 1, 107 | 'text' => '显示全文', 108 | 'label' => '默认首页、分类页显示摘要, 勾选后,开启后显示全文' 109 | ) 110 | ); 111 | 112 | // Add theme setting menu and page 113 | add_action( 'admin_menu', array( $this, 'menu' ) ); 114 | 115 | // Register wordpress plugins install extention 116 | add_action( 'tgmpa_register', array( $this, 'plugins' ) ); 117 | } 118 | 119 | public function menu() { 120 | add_menu_page( MUTHEME_NAME, MUTHEME_NAME, 'manage_options', 'mutheme_setting', array( 121 | $this, 122 | 'page' 123 | ), mutheme_image( 'setting-icon.png' ), 59 ); 124 | 125 | add_submenu_page( 'mutheme_setting', MUTHEME_NAME . ' 主题设置', '主题设置', 'edit_themes', 'mutheme_setting', array( 126 | $this, 127 | 'page' 128 | ) ); 129 | add_submenu_page( 'mutheme_setting', MUTHEME_NAME . ' 说明文档', '说明文档', 'edit_themes', 'mutheme_help', array( 130 | $this, 131 | 'help' 132 | ) ); 133 | 134 | add_action( 'admin_init', array( $this, 'settings_group' ) ); 135 | } 136 | 137 | public function page() { 138 | if ( isset( $_REQUEST['settings-updated'] ) ) { ?> 139 |
    140 |

    主题设置已保存.

    141 |
    142 | 146 | 147 |
    148 |

    主题设置

    149 | 150 |
    151 | 152 | 153 | 154 | defaults as $key => $arr ) { 156 | ?> 157 | 158 | 161 | 171 | 172 | 174 | 175 |
    159 | 160 | 162 |

    163 | build( $arr ); ?> 164 |

    165 | %s

    ', $arr['label'] ); 168 | } 169 | ?> 170 |
    176 | 177 |
    178 |
    179 | 180 | 186 |
    187 |

    欢迎使用_local_shenyun

    188 | 189 |
    190 |
    191 |
    192 |

    功能说明

    193 | 194 |

    195 | 主题提供四种颜色(默认、新年红、理工蓝、青葱绿)以供选择,Gavatar头像默认采用多说源,可在后台关闭;主题提供了三个侧边栏小工具(最新文章、最新评论、热门文章);禁止加载Google Fonts,关闭了Wordpress 196 | 默认要输出的 head 部分功能,推荐使用七牛云加速会有更好的体验;本主题支持后台更新。 197 |

    198 |

    首页左上角logo替换位置在\public\images\logo.png 尺寸为205*60 缓冲图标为\public\images\placeholder.png 建议尺寸144*144 199 |

    200 | 主题推荐安装 WP-PostViews、WP-Zan 插件:WP-PostViews 是文章浏览量统计插件,热门文章小工具采用了此插件;WP-Zan 是文章点赞插件。 201 |

    202 |
    203 |
    204 |
    205 |
    206 |

    菜单图标

    207 | 208 |

    209 |

      210 | $val ) { 257 | ?> 258 |
    • 259 | 260 | 261 |
    • 262 | 265 |
    266 |

    267 |
    268 |
    269 |
    270 |
    271 |

    菜单设置

    272 | 273 |

    274 |

      275 |
    1. 菜单页面点击显示选项,勾选上CSS类
    2. 276 |
    3. 点击菜单右侧下三角,展开编辑选项;
    4. 277 |
    5. CSS类(可选)填选上相应的图标名称
    6. 278 |
    279 |

    280 |
    281 |
    282 |
    283 |
    284 |

    关于

    285 |

    本主题以[牧风]https://mufeng.me/大神的Kunkka 1.06为基础改进而来,经Alatelee二次修改http://agatelee.cn,又经神韵博客https://51shenyun.cn三次修改。

    286 |

    wordpress主题太多 在众多主题中 我偏偏喜欢上了这款 它简洁 没有花里胡哨 但是由于版本太老 且牧风大佬也早已停止更细 在使用中出现的BUG不仅奇穷千奇百怪!! 为此我在alatelee的修改版基础上 再次修改 修复了一些BUG 并优化了很多

    287 |

    本应有熊掌号改造来 但是由于技术有限 不会在主题设置里添加选项 如有需求可以看这篇文章JSON-LD改造及熊掌号搜索出图改造教程

    288 |

    Github项目/更新日志:https://github.com/ShenYun1/Kunkka

    289 |
    290 |
    291 |
    292 |
    293 | 'WP-Zan ', 304 | 'slug' => 'wp-zan', 305 | 'required' => false, 306 | ), 307 | array( 308 | 'name' => 'WP-PostViews ', 309 | 'slug' => 'wp-postviews', 310 | 'required' => false, 311 | ) 312 | ); 313 | 314 | /** 315 | * Array of configuration settings. Amend each line as needed. 316 | * If you want the default strings to be available under your own theme domain, 317 | * leave the strings uncommented. 318 | * Some of the strings are added into a sprintf, so see the comments at the 319 | * end of each line for what each argument will be. 320 | */ 321 | $config = array( 322 | 'domain' => MUTHEME_NAME, // Text domain - likely want to be the same as your theme. 323 | 'default_path' => '', // Default absolute path to pre-packaged plugins 324 | 'has_notices' => true, // Show admin notices or not 325 | 'is_automatic' => true, // Automatically activate plugins after installation or not 326 | 'message' => '', // Message to output right before the plugins table 327 | 'strings' => array( 328 | 'page_title' => __( '安装推荐插件', MUTHEME_NAME ), 329 | 'menu_title' => __( '安装插件', MUTHEME_NAME ), 330 | 'installing' => __( '正在安装插件: %s', MUTHEME_NAME ), 331 | // %1$s = plugin name 332 | 'oops' => __( '出错了.', MUTHEME_NAME ), 333 | 'notice_can_install_required' => _n_noop( MUTHEME_NAME . ' 需要安装下面的插件: %1$s.', MUTHEME_NAME . ' 需要安装下面的插件: %1$s.' ), 334 | // %1$s = plugin name(s) 335 | 'notice_can_install_recommended' => _n_noop( MUTHEME_NAME . ' 推荐安装下面的插件: %1$s.', MUTHEME_NAME . ' 推荐安装下面的插件: %1$s.' ), 336 | // %1$s = plugin name(s) 337 | 'notice_cannot_install' => _n_noop( '对不起,您没有权限安装%s插件.请联系网站管理员安装.', '对不起,您没有权限安装%s插件.请联系网站管理员安装..' ), 338 | // %1$s = plugin name(s) 339 | 'notice_can_activate_required' => _n_noop( '必需的插件没有被启用: %1$s.', '必需的插件没有被启用: %1$s.' ), 340 | // %1$s = plugin name(s) 341 | 'notice_can_activate_recommended' => _n_noop( '推荐的插件没有被启用: %1$s.', '推荐的插件没有被启用: %1$s.' ), 342 | // %1$s = plugin name(s) 343 | 'notice_cannot_activate' => _n_noop( '对不起,您没有权限启用%s插件,请联系网站管理员启用插件.', '对不起,您没有权限启用%s插件,请联系网站管理员启用插件.' ), 344 | // %1$s = plugin name(s) 345 | 'notice_ask_to_update' => _n_noop( '为了获得最好的兼容性,请更新插件(注意:更新后将不再是汉化版本): %1$s.', '为了获得最好的兼容性,请更新插件(注意:更新后将不再是汉化版本): %1$s.' ), 346 | // %1$s = plugin name(s) 347 | 'notice_cannot_update' => _n_noop( '对不起,您没有权限更新%s插件,请联系网站管理员更新d.', '对不起,您没有权限更新%s插件,请联系网站管理员更新。' ), 348 | // %1$s = plugin name(s) 349 | 'install_link' => _n_noop( '开始安装插件', '开始安装插件' ), 350 | 'activate_link' => _n_noop( '启用已安装的插件。', '启用已安装的插件' ), 351 | 'return' => __( '继续安装推荐插件。', MUTHEME_NAME ), 352 | 'plugin_activated' => __( '成功开启插件。', MUTHEME_NAME ), 353 | 'complete' => __( '所有插件已成功安装并开启 %s。', MUTHEME_NAME ), 354 | // %1$s = dashboard link 355 | 'nag_type' => 'updated', 356 | // Determines admin notice type - can only be 'updated' or 'error' 357 | 'dismiss' => '不再提示' 358 | ) 359 | ); 360 | 361 | tgmpa( $plugins, $config ); 362 | } 363 | 364 | private function build( $obj ) { 365 | switch ( $obj['type'] ) { 366 | case 'number': 367 | $this->number( $obj['key'] ); 368 | break; 369 | 370 | case 'input': 371 | $this->input( $obj['key'] ); 372 | break; 373 | 374 | case 'textarea': 375 | $this->textarea( $obj['key'] ); 376 | break; 377 | 378 | case 'radio': 379 | $this->radio( $obj['key'], $obj['value'] ); 380 | break; 381 | 382 | case 'checkbox': 383 | $this->checkbox( $obj['key'], $obj['value'], $obj['text'] ); 384 | break; 385 | } 386 | } 387 | 388 | private function input( $key ) { 389 | printf( '', MUTHEME_NAME, $key, mutheme_settings( $key ) ); 390 | } 391 | 392 | private function number( $key ) { 393 | printf( '', MUTHEME_NAME, $key, mutheme_settings( $key ) ); 394 | } 395 | 396 | private function textarea( $key ) { 397 | printf( '', MUTHEME_NAME, $key, mutheme_settings( $key ) ); 398 | } 399 | 400 | private function radio( $key, $value ) { 401 | $real_val = mutheme_settings( $key ); 402 | 403 | foreach ( $value as $_key => $_val ) { ?> 404 | 411 | 418 | 424 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /public/fonts/icomoon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | --------------------------------------------------------------------------------