网站升级主题版本时需要修改的内容

1、修改脚注上的Powered by WordPress为备案信息
/**
*在footer.php中找到 ,并替换下面的

<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentytwelve' ) ); ?>" class="imprint" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentytwelve' ); ?>">
<?php
/* translators: %s: WordPress */
printf( __( 'Proudly powered by %s', 'twentytwelve' ), 'WordPress' );
?>
</a>

为:*/

<?php _e("Copyright", '101kPa'); ?> &copy; 2011-<?php echo date('Y'); ?> &middot; <?php _e("All Rights Reserved", '101kPa'); ?> &middot; <?php _e("101kPa.com by", '101kPa'); ?> <a href=" https://www.101kpa.com/?page_id=2">J.Y. WANG</a><br />
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">京ICP备10041129号</a><strong> | </strong><a href="http://www.beian.gov.cn" target="_blank" rel="noopener">京公网安备11010802012744号</a>

2、修改翻页插件
/**
*在functions.php中部找到下面的内容,并替换

<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>

为:*/

<?php wp_pagenavi(); ?>

3、替换Gravatar头像为Cravatar头像
/**
由于Gravatar全球通用头像被墙,会影响网页速度。将替换Gravatar头像为Cravatar头像。
*在functions.php尾部添加下面的函数
*/

if ( ! function_exists( 'get_cravatar_url' ) ) {
    function get_cravatar_url( $url ) {
        $sources = array(
            'www.gravatar.com',
            '0.gravatar.com',
            '1.gravatar.com',
            '2.gravatar.com',
            'secure.gravatar.com',
            'cn.gravatar.com'
        );
        return str_replace( $sources, 'cravatar.cn', $url );
    }
    add_filter( 'um_user_avatar_url_filter', 'get_cravatar_url', 1 );
    add_filter( 'bp_gravatar_url', 'get_cravatar_url', 1 );
    add_filter( 'get_avatar_url', 'get_cravatar_url', 1 );
}

4、不显示博客页和单内容页的特色图像
/**
*如果在帖子中设置了特色图片,WordPress主题会在单内容页的顶部和博客页(文章页)显示一个大的特色图片。
*为不显示博客页和单内容页的特色图像,需要将content.php文件中第20行-24行注释掉,如下:
*/

<?php
# if ( ! post_password_required() && ! is_attachment() ) :
# the_post_thumbnail();
# endif;
?>

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注