wordpress去除Category Archives也就是我们所说的分类归档。下面我们要把这个彻底去除下:

针对The7.3版本,我们首先找到路径:dt-the7\inc\helpers\page-title.php

首先我们找到这断函数:

自动草稿

自动草稿

其实我们只需要修改:

$title = sprintf( __( ‘Category Archives: %s’, ‘the7mk2’ ), ‘<span>’ . single_cat_title( ”, false ) . ‘</span>’ );

看到Category Archives:,可以删掉,也可以修改成我们想要显示的。一般我们直接删了就完事

了。去掉之后就会变成如下代码段:

function presscore_get_page_title() {
$title = ”;

if ( is_page() || is_single() ) {
$title = get_the_title();

} else if ( is_search() ) {
$title = sprintf( __( ‘Search Results for: %s’, ‘the7mk2’ ), ‘<span>’ . get_search_query() . ‘</span>’ );

} else if ( is_archive() ) {

if ( is_category() ) {
$title = sprintf( __( ‘%s’, ‘the7mk2’ ), ‘<span>’ . single_cat_title( ”, false ) . ‘</span>’ );

} elseif ( is_tag() ) {
$title = sprintf( __( ‘%s’, ‘the7mk2’ ), ‘<span>’ . single_tag_title( ”, false ) . ‘</span>’ );

} elseif ( is_author() ) {
the_post();
$title = sprintf( __( ‘ %s’, ‘the7mk2’ ), ‘<span class=”vcard”><a class=”url fn n” href=”‘%20.%20esc_url(%20get_author_posts_url(%20get_the_author_meta(%20″ID” ) ) ) . ‘” title=”‘ . esc_attr( get_the_author() ) . ‘” rel=”me”>’ . get_the_author() . ‘</a></span>’ );
rewind_posts();

} elseif ( is_day() ) {
$title = sprintf( __( ‘ %s’, ‘the7mk2’ ), ‘<span>’ . get_the_date() . ‘</span>’ );

} elseif ( is_month() ) {
$title = sprintf( __( ‘%s’, ‘the7mk2’ ), ‘<span>’ . get_the_date( ‘F Y’ ) . ‘</span>’ );

} elseif ( is_year() ) {
$title = sprintf( __( ‘%s’, ‘the7mk2’ ), ‘<span>’ . get_the_date( ‘Y’ ) . ‘</span>’ );

} else {
$title = __( ‘Archives:’, ‘the7mk2’ );

}

ok,完成之后,看到的效果就如同:

自动草稿

自动草稿

看起来是不是非常清爽了。