ミライハック
  • Home
  • Categories
  • About

>> Home / システム開発

PagelinesテーマのPHP修正

∵ Takayoshi Saito ∴ 2012-11-28 ∞ 1'

WordPress PagelinesテーマのSEO修正

細かな設定ができて何かと便利なWordPressのPagelinesテーマですが、SEO上、タイトルタグに問題があります。そのため、以下のファイル、 wp-content/themes/pagelines/includes/library.templates.php のpagelines_filter_wp_titleを以下のように修正します。

function pagelines_filter_wp_title( $title ) {

global $wp_query, $s, $paged, $page;
$sep = __( '|','pagelines' );
$new_title = get_bloginfo( 'name' ) . ' ';
$bloginfo_description = get_bloginfo( 'description' );
if( is_feed() ) {
    $new_title = $title;
} elseif ( ( is_home () || is_front_page() ) && ! empty( $bloginfo_description ) ) {
    $new_title .= $sep . ' ' . $bloginfo_description;
} elseif ( is_category() ) {
    $new_title .= $sep . ' ' . single_cat_title( '', false );
} elseif ( is_single() || is_page() ) {
    $new_title = single_post_title( '', false );
} elseif ( is_search() ) {
    $new_title .= $sep . ' ' . sprintf( __( 'Search Results: %s','pagelines' ), esc_html( $s ) );
} else
    $new_title .= $sep . ' ' . $title;
if ( $paged >= 2 || $page >= 2 ) {
    $new_title .= ' ' . $sep . ' ' . sprintf( __( 'Page: %s', 'pagelines' ), max( $paged, $page ) );
}
return apply_filters( 'pagelines_meta_title', $new_title );

}

ページ送りの日本語化

標準でページ送りが英語になってしまっているので、日本語化します。ファイルは同じくwp-content/themes/pagelines/includes/library.templates.phpです。

elseif (show_posts_nav()) : ?>
    
        - 
            
        
        - 
Search

Categories
  • LInux
  • インターネット
  • インフラ
  • エッセイ
  • ゲーム
  • システム開発
  • セキュリティ
  • データサイエンス
  • 国際関係
  • 政治
  • 歴史
  • 社会学
  • 自己紹介
  • 行ってきた

Pages
  • 齊藤貴義
  • 職務経歴
  • スクレイピング・ハッキング・ラボ サポートページ
  • 『爆速開発を支えるClaude Code上級者テクニック』サポートページ

2026 © Takayoshi Saito | Twitter GitHub | Built on Zola