まとまりのないブログ

something which something is something

wordpress

Get Latest Post Title:wordpressの最新の投稿記事のタイトルのみを取得するプラグイン

投稿日:

wordpressで投稿した最新の投稿記事のタイトルのみを取得するプラグイン

このプラグインは、公開済みの投稿記事の最も新しい記事タイトルを表示させるためのプラグインです。リンクではなく、リストでもなく、ただのテキストとして最新の記事タイトルを表示します。

プラグインの名前

Get Latest Post Title (最新の投稿記事のタイトルを取得する)

使い方

  1. 下記よりプラグインファイルをダウンロードしてください。
  2. ダウンロードしてzipファイルを解凍するとget_latest_post_title.phpというファイルが存在します。それをwordpressのプラグインディレクトリへアップロードしてください。
  3. 管理画面より先ほどアップロードしたプラグインを有効化してください。
  4. 最新の記事タイトルを表示したいところに<?php get_latest_post_title(); ?>を挿入するとそこに最新の記事タイトルが表示されます。

ダウンロード

download.png

どのような場合に使うか?

例えば、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

  1. Upload get_latest_post_title.php to your WordPress /wp-content/plugins/ directory or install through the auto-installer
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. To this <?php get_latest_post_title(); ?> insert in the place that wants to display the latest article title.

download

download.png

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

-wordpress
-

執筆者:


comment

メールアドレスが公開されることはありません。

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)

関連記事

no image

pageIDを指定して、その子要素を表示させる方法

<?php global $id; wp_list_pages(“child_of=$id&sort_column=menu_order&title_li=&#822 …

no image

wordpressのダッシュボード画面にあるその他の情報を削除

wordpressの管理画面にログインすると、ダッシュボード内にその他のサイトの更新情報が標準で表示されるようになっている。毎回ログインするたびにrssを読み込んでいるようなので必要ないから表示されな …

no image

wordpressの投稿内容でphpを使えるようにするプラグイン PHP Exec Plugin

WordPress PHP Exec Plugin 記事の投稿ページ内でphpのコードを利用できるようにするプラグイン。 ダウンロード 下記のページにアクセスし、Wordpress PHP Exec …

no image

wordpressのタグとは何か

wordpressをアップグレードしてからいろいろといじっていたら新しく「タグ」というものが存在しているのに気づいた。投稿記事に関係するキーワードをタグとして登録しておき、投稿時にそのタグを関連付ける …

no image

windowsにsubversionをインストールする

windowsにsubversionをインストールする。(subversionが何かもわかっていないれど・・・)