wordpressで投稿した最新の投稿記事のタイトルのみを取得するプラグイン
このプラグインは、公開済みの投稿記事の最も新しい記事タイトルを表示させるためのプラグインです。リンクではなく、リストでもなく、ただのテキストとして最新の記事タイトルを表示します。
プラグインの名前
Get Latest Post Title (最新の投稿記事のタイトルを取得する)
使い方
- 下記よりプラグインファイルをダウンロードしてください。
- ダウンロードしてzipファイルを解凍するとget_latest_post_title.phpというファイルが存在します。それをwordpressのプラグインディレクトリへアップロードしてください。
- 管理画面より先ほどアップロードしたプラグインを有効化してください。
- 最新の記事タイトルを表示したいところに
<?php get_latest_post_title(); ?>
を挿入するとそこに最新の記事タイトルが表示されます。
ダウンロード
どのような場合に使うか?
例えば、wordpressのhtmlのタイトル要素に入れることで、頻繁に更新されるブログサイトはSEO的に目立ち易くなります。GIGAZINEのように一番新しい記事タイトルを、タイトル要素に表示したい場合などに使うことができます。
記述例
トップページのタイトルはサイト名と最新記事タイトルを表示して、それ以外のページを表示する場合はページタイトルとサイト名を表示するというような場合。
<?php if(is_home()): ?> <title><?php bloginfo('name'); ?> - <?php get_latest_post_title(); ?></title> <?php else: ?> <title><?php wp_title(' - ', true, 'right'); ?><?php bloginfo('name'); ?></title> <?php endif; ?>
作者から一言
これをプラグインであると言うと他のプラグイン作者に悪い気がしますが、一応プラグインです。wordpressの標準の関数で欲しい機能ではあるけれど、標準関数にするにしては誰もが頻繁に使う機能ではないため、不本意ながらプラグインとして作ったという感じです。誰か他の人も同じようなことを考えていたら若干時間が短縮できると思うので公開します。不具合があった場合はご連絡ください。
Get Latest Post Title
Plug in to acquire only the title of the latest online posting which I contributed in wordpress
This plug in is plug in to let you display the newest article title of the online postings which is finished with an exhibition. Not a link, I display the latest article title as just a text without by a list.
The name of the plug in
Get Latest Post Title
install
- Upload get_latest_post_title.php to your WordPress /wp-content/plugins/ directory or install through the auto-installer
- Activate the plugin through the ‘Plugins’ menu in WordPress
- To this
<?php get_latest_post_title(); ?>
insert in the place that wants to display the latest article title.
download
When how is it, do you use it?
For example, the blog site that is updated frequently by putting it in a title element of the html of wordpress is easy to become outstanding for SEO.I can use the newest article title for the cases that I want to display in a title element like GIGAZINE.
Code Sample
When the title of the top page displays the site name and a latest story title, and display a page except it; a case to display page title and the site name.
<?php if(is_home()): ?> <title><?php bloginfo('name'); ?> - <?php get_latest_post_title(); ?></title> <?php else: ?> <title><?php wp_title(' - ', true, 'right'); ?><?php bloginfo('name'); ?></title> <?php endif; ?>
message
this plugin is not wordpress general function…but,It is plug in somehow
「Get Latest Post Title:wordpressの最新の投稿記事のタイトルのみを取得するプラグイン」への1件のフィードバック