<?php
// 一、不要长时光连接
function get_ssl_avatar($avatar) {
//$avatar = preg_replace("/.*/avatar/(.*)?s=([d]+)&.*/","<img class="avatar avatar-" src="https://secure.gravatar.com/avatar/
<?php
// 一、不要长时光连接
function get_ssl_avatar($avatar) {
//$avatar = preg_replace("/.*/avatar/(.*)?s=([d]+)&.*/","<img class="avatar avatar-$2" src="https://secure.gravatar.com/avatar/$1?s=$2" alt="" width="$2" height="$2" />",$avatar);
return $avatar;
};
add_filter("get_avatar", "get_ssl_avatar");
// 二、缩略图添加
if ( function_exists( "add_theme_support" ) ) add_theme_support( "post-thumbnails" );
// 三、获得内容的第一张图
function catch_that_image() {
global $post, $posts;
$first_img = "";
ob_start();
ob_end_clean();
$output = preg_match_all("/<img.+src=[\""]([^\""]+)[\""].*>/i", $post->post_content, $matches);
//四、获得文章中第一张图片的路径并输出
$first_img = $matches [1] [0];
//五、如果文章无图片,获得自定义图片
if(empty($first_img)){ //Defines a default image
$first_img = "/images/default.jpg";
//请自行设置一张default.jpg图片
}
return $first_img;
}
//六、制止体系和插件更新
add_filter("pre_site_transient_update_core", create_function("$a", "return null;")); // 关闭核心提醒
add_filter("pre_site_transient_update_plugins", create_function("$a", "return null;")); // 关闭插件提醒
add_filter("pre_site_transient_update_themes", create_function("$a", "return null;")); // 关闭主题提醒
remove_action("admin_init", "_maybe_update_core"); // 制止 WordPress 检讨更新
remove_action("admin_init", "_maybe_update_plugins"); // 制止 WordPress 更新插件
remove_action("admin_init", "_maybe_update_themes"); // 制止 WordPress 更新主题
//七、设置摘要字数
function custom_excerpt_length( $length ) {
return 100;
}
add_filter( "excerpt_length", "custom_excerpt_length", 999 );
//八、分页插件
//调用分页办法 <div class="page_navi fqj_fenye"> php par_pagenavi(9); </div>中间加php标志符号
function par_pagenavi($range = 9){
global $paged, $wp_query;
if ( !$max_page ) {$max_page = $wp_query->max_num_pages;}
if($max_page > 1){if(!$paged){$paged = 1;}
if($paged != 1){echo "<a href=#>
?s=" alt="" width="" height="" />",$avatar);
return $avatar;
};
add_filter("get_avatar", "get_ssl_avatar");
// 二、缩略图添加
if ( function_exists( "add_theme_support" ) ) add_theme_support( "post-thumbnails" );
// 三、获得内容的第一张图
function catch_that_image() {
global $post, $posts;
$first_img = "";
ob_start();
ob_end_clean();
$output = preg_match_all("/<img.+src=[\""]([^\""]+)[\""].*>/i", $post->post_content, $matches);
//四、获得文章中第一张图片的路径并输出
$first_img = $matches [1] [0];
//五、如果文章无图片,获得自定义图片
if(empty($first_img)){ //Defines a default image
$first_img = "/images/default.jpg";
//请自行设置一张default.jpg图片
}
return $first_img;
}
//六、制止体系和插件更新
add_filter("pre_site_transient_update_core", create_function("$a", "return null;")); // 关闭核心提醒
add_filter("pre_site_transient_update_plugins", create_function("$a", "return null;")); // 关闭插件提醒
add_filter("pre_site_transient_update_themes", create_function("$a", "return null;")); // 关闭主题提醒
remove_action("admin_init", "_maybe_update_core"); // 制止 WordPress 检讨更新
remove_action("admin_init", "_maybe_update_plugins"); // 制止 WordPress 更新插件
remove_action("admin_init", "_maybe_update_themes"); // 制止 WordPress 更新主题
//七、设置摘要字数
function custom_excerpt_length( $length ) {
return 100;
}
add_filter( "excerpt_length", "custom_excerpt_length", 999 );
//八、分页插件
//调用分页办法 <div class="page_navi fqj_fenye"> php par_pagenavi(9); </div>中间加php标志符号
function par_pagenavi($range = 9){
global $paged, $wp_query;
if ( !$max_page ) {$max_page = $wp_query->max_num_pages;}
if($max_page > 1){if(!$paged){$paged = 1;}
if($paged != 1){echo "<a href=#<?php
// 一、不要长时光连接
function get_ssl_avatar($avatar