WP主题

最新RiPro主题文章页标题美化代码

admin · 3月3日 · 2021年 746次已读

教程开始

找到wp-content/themes/ripro/assets/css/diy.css将下方css代码复制至diy.css并保存

/*辣条科技 www.wzzti.com*/
@charset "utf-8";
/* 详细页作者信息 */
.sjblog-avatar {
    width: 50px;
    float: left;
}
.sjblog-avatar img {
    float: left;
    width: 50px;
    border-radius: 50%;
    margin-right: 20px;
}
.sjblog-tgroup{
    padding-left: 66px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f5f5f5;
    margin-bottom: 20px;
}
.sjblog-tgroup .entry-header{ margin-bottom: 0 !important;}
.article-content .entry-header .entry-title{
    padding-bottom:0;
    margin-bottom: 0 !important;
    border-bottom: none;
}
.sjblog-name {
	padding-top:5px;
    display: block;
    font-size: 13px;
    color: #cdcdcd;
}
.sjblog-name a{
    color: #cdcdcd;
}
.sjblog-name a:hover{
    color: #2756fc;
}
.sjblog-time {
    margin-left: 20px;
}

/* 详细页作者信息 */

找到wp-content/themes/ripro/parts/single-header.php将下方php代码复制至single-header.php并保存

<!--辣条科技 wzzti.com--> <div class="cao_entry_header"> <div class="sjblog-avatar"> <?php echo get_avatar( get_the_author_meta( 'email' ), '96', null, get_the_author_meta( 'display_name' ) ); ?> </div> <div class="sjblog-tgroup"> <?php edit_post_link('[编辑]'); ?> <?php if ( ! is_page() ) { cao_entry_header( array( 'tag' => 'h1') ); } else { cao_entry_header( array( 'tag' => 'h1', 'link' => false ) ); } get_template_part( 'parts/entry-subheading' ); ?> <header class="entry-header"> <span class="sjblog-name">作者: <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID', $author_id ) ) ); ?>"><?php the_author(); ?></a> <span class="sjblog-time"> 发布时间:<i class="fa fa-clock-o"></i> <?php echo the_time('Y-m-j'); ?></span> <span class="sjblog-views"> <?php echo '<i class="fa fa-eye"></i> '._get_post_views();?> </span> 人阅读</span> </div> </div>

原文链接直达