【WordPress】記事名の不要な部分を削除する【へのパーマリンク】

WordPressで記事名の「title」に付けられる「へのパーマリンク」を削除する方法です。
cbdd20b1

WordPress の記事一覧ページで、記事タイトルの「title」タグは「 記事名 +  へのパーマリンク」となっています。(テーマによってはない場合もあります)

そのためマウスオーバー時は以下のように

entry-title

 

これを下のような記事名だけにする方法です。
entry-title (2)


へのパーマリンク削除する方法

※テーマによって細部が違う場合があります。
「ダッシュボード」 → 「外観」 → 「テーマ編集」から以下の2つのファイルを編集します。

content.php

<h1?class="entry-title"><a href="<?php the_permalink(); ?>" title="
<?php echo esc_attr( sprintf( __( 'Permanent Link to %s', 'f2' ), the_title_attribute( 'echo=0' ) ) ); ?>
" rel="bookmark"><?php the_title(); ?></a></h1>

<h1?class="entry-title"><a href="<?php the_permalink(); ?>" title="
<?php the_title(); ?>
" rel="bookmark"><?php the_title(); ?></a></h1>

content-aside.php

<h1?class="entry-title"><a href="<?php the_permalink(); ?>" title="
<?php echo esc_attr( sprintf( __( 'Permanent Link to %s', 'f2' ), the_title_attribute( 'echo=0' ) ) ); ?>
" rel="bookmark"><?php the_title(); ?></a></h1>

<h1?class="entry-title"><a href="<?php the_permalink(); ?>" title="
<?php the_title(); ?>
" rel="bookmark"><?php the_title(); ?></a></h1>