"wordpress的文章标题形式由"文章标题+博客标题"改回基本的"文章标题""

Published on Aug. 22, 2023, 12:05 p.m.

打算把wordpress的文章标题形式由”文章标题+博客标题”改回基本的”文章标题”,不过网络上找到的都存在一个问题就是首页的分页一直显示博客标题而不会是 “博客名+page *”

这种形式,想来势必会造成重复标题,也不知道为什么那么多人还是打着对搜索友好的标题写法来的.以下方式可以实现每页都 “博客名+page* “.

<title>

<?php if ( is_category() ) {

echo ‘Category Archive for "‘; single_cat_title(); echo ‘" | ‘; bloginfo( ‘name’ );

} elseif ( is_tag() ) {

echo ‘Tag Archive for "‘; single_tag_title(); echo ‘" | ‘; bloginfo( ‘name’ );

} elseif ( is_archive() ) {

wp_title(‘’); echo ‘ Archive | ‘; bloginfo( ‘name’ );

} elseif ( is_search() ) {

echo ‘Search for "‘.wp_specialchars($s).’" | ‘; bloginfo( ‘name’ );

}

elseif ( is_home() || is_front_page() ) {

bloginfo( ‘name’ ); echo ‘ | ‘. sprintf(**(‘Page %s’, ‘’), max($paged, $page));

}  elseif ( is_404() ) {

echo ‘Error 404 Not Found | ‘; bloginfo( ‘name’ );

} elseif ( is_single() ) {

wp_title(‘’);

} else {

echo wp_title( ‘ | ‘, false, right ); bloginfo( ‘name’ );

} ?>

</title>

<title>

<?php if ( is_category() ) {

echo ‘Category Archive for "‘; single_cat_title(); echo ‘" | ‘; bloginfo( ‘name’ );

} elseif ( is_tag() ) {

echo ‘Tag Archive for "‘; single_tag_title(); echo ‘" | ‘; bloginfo( ‘name’ );

} elseif ( is_archive() ) {

wp_title(‘’); echo ‘ Archive | ‘; bloginfo( ‘name’ );

} elseif ( is_search() ) {

echo ‘Search for "‘.wp_specialchars($s).’" | ‘; bloginfo( ‘name’ );

}

elseif ( is_home() || is_front_page() ) {

bloginfo( ‘name’ ); echo ‘ | ‘. sprintf(**(‘Page %s’, ‘’), max($paged, $page));

}  elseif ( is_404() ) {

echo ‘Error 404 Not Found | ‘; bloginfo( ‘name’ );

} elseif ( is_single() ) {

wp_title(‘’);

} else {

echo wp_title( ‘ | ‘, false, right ); bloginfo( ‘name’ );

} ?>

</title>

不过也存在问题首页是 “博客名+page 0”,艾真实无奈只好启用插件吧,分别尝试过SEO Ultimate,WordPress SEO,无奈以上两款实在太过powerful,还是选择了轻量级的Platinum SEO Pack.


另外,今天提交申请了payoneer,以后paypal提款直接到payoneer就方便多了.payoneer的收费也确实有点…不过还是比直接paypal电汇要便宜些吧.今天注册了cj尝试下,不知道未来能够从中获取收益,只能说努力吧.