本帖基于V3.3修改,一些细节可以参考:http://zmingcx.com/ality-themes-faq.html
控制缩略图的大小
查看style.css,差不多577~593行左右,有2项: /** 缩略图 **/ 里面修改
控制左侧的宽度,
查看style.css,约5.3行开始
/** 左侧 **/
#primary {
float: left;
width: 660px;
控制文章内超链接的颜色
查看style.css,大约32行开始:
/** 链接 **/
a {
color: #555;
text-decoration: none;
}
添加如下代码:
.content-main a { color:#04A4CC;}
去掉文章链接小图新
打开Ality\js目录的script.js 查找并删除:
- // 链接图标
- $(“.content-main p a, .content-main ul li a, .content-main ol li a”).each(function() {
- if ($(this).children(‘img’).length <= 0) {
- $(this).append(‘<i class=“icon-link”></i>’);
- }
- });
控制首页文章的字数
content.php里面的:
<?php } else { echo mb_strimwidth(strip_tags(apply_filters(‘the_content’, $post->post_content)), 0, 280,”…”); } ?>
//干掉古藤保
在functions.php添加:
add_filter('use_block_editor_for_post', '__return_false');
remove_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
删除标题左边的“|”
/inc/functions/seo.php文件中修改,|改成-
删除文章内的“喜欢”“评论”“分享”
single.php内删除 <?php get_template_part( ‘inc/social’ ); ?>
不希望本站推荐模块的文章显示缩略图
在主题包下文件inc/functions/widgets.php注释掉
WordPress首页排除(不显示)特定(指定)分类文章
复制下面的代码到你的主题functions.php文件:
- function exclude_category_home( $query ) {
- if ( $query->is_home ) {
- $query->set( ‘cat’, ‘-5, -34’ );
- }
- return $query;
- }
- add_filter( ‘pre_get_posts’, ‘exclude_category_home’ );
修改第3行的分类ID,然后保存文件,就大功告成了。
表格问题,添加自适应表格:
参考:http://zmingcx.com/add-the-table-form.html
table {
border: 1px solid #ccc;
width: 80%;
margin: 0;
padding: 0;
border-collapse: collapse;
border-spacing: 0;
margin: 0 auto;
}
table tr {
border: 1px solid #ddd;
padding: 5px;
}
table th, table td {
padding: 10px;
text-align: center;
}
table th {
text-transform: uppercase;
font-size: 14px;
letter-spacing: 1px;
}
@media screen and (max-width: 600px) {
table {
border: 0;
}
table thead {
display: none;
}
table tr {
margin-bottom: 10px;
display: block;
border-bottom: 2px solid #ddd;
}
table td {
display: block;
text-align: right;
font-size: 13px;
border-bottom: 1px dotted #ccc;
}
table td:last-child {
border-bottom: 0;
}
table td:before {
content: attr(data-label);
float: left;
text-transform: uppercase;
font-weight: bold;
}
}
发表回复