- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
「テンプレートタグ/bloginfo」の版間の差分
細 (1 版) |
(07:17, 5 April 2012 MTanriverdi 版 を反映。一部未翻訳です。) |
||
1行目: | 1行目: | ||
− | + | {{NeedTrans|一部}} | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | [[en: | + | <div id="Description"> |
+ | == 説明 == | ||
+ | Displays information about your blog, mostly gathered from the information you supply in your '''User Profile''' and '''General Options''' from the WordPress '''Administration''' panels (Settings → General). It can be used anywhere within a page template. This always prints a result to the browser. If you need the values for use in PHP, use [[テンプレートタグ/get_bloginfo|<tt>get_bloginfo()</tt>]]. | ||
+ | </div> | ||
+ | |||
+ | <div id="Usage"> | ||
+ | == 使い方 == | ||
+ | <pre><?php bloginfo( $show ); ?></pre> | ||
+ | </div> | ||
+ | |||
+ | <div id="Parameters"> | ||
+ | == パラメータ == | ||
+ | Note that <strong>directory URLs are missing trailing slashes</strong>. If using child-theme, that has parent-theme as the parent. Using <tt>bloginfo()</tt> without a parameter will default to <tt>bloginfo('name')</tt>. | ||
+ | |||
+ | <pre> | ||
+ | name = Testpilot | ||
+ | description = Just another WordPress blog | ||
+ | admin_email = admin@example | ||
+ | |||
+ | url = http://example/home [use home_url('/') instead] | ||
+ | wpurl = http://example/home/wp [use site_url('/') instead] | ||
+ | |||
+ | stylesheet_directory = http://example/home/wp/wp-content/themes/child-theme | ||
+ | stylesheet_url = http://example/home/wp/wp-content/themes/child-theme/style.css | ||
+ | template_directory = http://example/home/wp/wp-content/themes/parent-theme | ||
+ | template_url = http://example/home/wp/wp-content/themes/parent-theme | ||
+ | |||
+ | atom_url = http://example/home/feed/atom | ||
+ | rss2_url = http://example/home/feed | ||
+ | rss_url = http://example/home/feed/rss | ||
+ | pingback_url = http://example/home/wp/xmlrpc.php | ||
+ | rdf_url = http://example/home/feed/rdf | ||
+ | |||
+ | comments_atom_url = http://example/home/comments/feed/atom | ||
+ | comments_rss2_url = http://example/home/comments/feed | ||
+ | |||
+ | charset = UTF-8 | ||
+ | html_type = text/html | ||
+ | language = en-US | ||
+ | text_direction = ltr | ||
+ | version = 3.1 | ||
+ | </pre> | ||
+ | </div> | ||
+ | |||
+ | <div id="Examples"> | ||
+ | == 用例 == | ||
+ | |||
+ | === ブログのタイトルを表示 === | ||
+ | |||
+ | ブログのタイトルを<h1>タグで囲んで表示。 | ||
+ | |||
+ | <pre><h1><?php bloginfo('name'); ?></h1></pre> | ||
+ | |||
+ | === リンク内でブログのタイトルを表示 === | ||
+ | |||
+ | ブログのタイトルをリンク内で表示。 | ||
+ | |||
+ | <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a> | ||
+ | |||
+ | === 文字コードの表示 === | ||
+ | ブログで使われている文字コードの表示 (例: utf-8) | ||
+ | |||
+ | <p>Character set: <?php bloginfo('charset'); ?> </p> | ||
+ | |||
+ | ===ブログの概要(キャッチフレーズ)を表示=== | ||
+ | ダッシュボードの「設定」>「一般設定」で入力したキャッチフレーズを表示。 | ||
+ | |||
+ | <p><?php bloginfo('description'); ?> </p> | ||
+ | </div> | ||
+ | |||
+ | <div id="Notes"> | ||
+ | == 注 == | ||
+ | * [[テンプレートタグ/get_bloginfo|<tt>get_bloginfo()</tt>]] を使用。 | ||
+ | </div> | ||
+ | |||
+ | <div id="Change Log"> | ||
+ | == 変更履歴 == | ||
+ | * Since: 0.71 | ||
+ | </div> | ||
+ | |||
+ | <div id="Source File"> | ||
+ | == ソースファイル == | ||
+ | <tt>bloginfo()</tt> は {{Trac|wp-includes/general-template.php}} にあります。 | ||
+ | |||
+ | {{原文|Function Reference/bloginfo|115544}}<!-- 07:17, 5 April 2012 MTanriverdi 版 --> | ||
+ | |||
+ | </div> | ||
+ | |||
+ | <div id="Related"> | ||
+ | == 関連 == | ||
+ | * [[テンプレートタグ/get_bloginfo|<tt>get_bloginfo()</tt>]] | ||
+ | |||
+ | </div> | ||
+ | |||
+ | {{Tag Footer}} | ||
+ | |||
+ | [[Category:テンプレートタグ]] |
2013年2月22日 (金) 21:12時点における版
このページ「テンプレートタグ/bloginfo」は一部未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています。
目次
説明
Displays information about your blog, mostly gathered from the information you supply in your User Profile and General Options from the WordPress Administration panels (Settings → General). It can be used anywhere within a page template. This always prints a result to the browser. If you need the values for use in PHP, use get_bloginfo().
使い方
<?php bloginfo( $show ); ?>
パラメータ
Note that directory URLs are missing trailing slashes. If using child-theme, that has parent-theme as the parent. Using bloginfo() without a parameter will default to bloginfo('name').
name = Testpilot description = Just another WordPress blog admin_email = admin@example url = http://example/home [use home_url('/') instead] wpurl = http://example/home/wp [use site_url('/') instead] stylesheet_directory = http://example/home/wp/wp-content/themes/child-theme stylesheet_url = http://example/home/wp/wp-content/themes/child-theme/style.css template_directory = http://example/home/wp/wp-content/themes/parent-theme template_url = http://example/home/wp/wp-content/themes/parent-theme atom_url = http://example/home/feed/atom rss2_url = http://example/home/feed rss_url = http://example/home/feed/rss pingback_url = http://example/home/wp/xmlrpc.php rdf_url = http://example/home/feed/rdf comments_atom_url = http://example/home/comments/feed/atom comments_rss2_url = http://example/home/comments/feed charset = UTF-8 html_type = text/html language = en-US text_direction = ltr version = 3.1
用例
ブログのタイトルを表示
ブログのタイトルを<h1>タグで囲んで表示。
<h1><?php bloginfo('name'); ?></h1>
リンク内でブログのタイトルを表示
ブログのタイトルをリンク内で表示。
<a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a>
文字コードの表示
ブログで使われている文字コードの表示 (例: utf-8)
<p>Character set: <?php bloginfo('charset'); ?> </p>
ブログの概要(キャッチフレーズ)を表示
ダッシュボードの「設定」>「一般設定」で入力したキャッチフレーズを表示。
<p><?php bloginfo('description'); ?> </p>
注
- get_bloginfo() を使用。
変更履歴
- Since: 0.71
ソースファイル
bloginfo() は wp-includes/general-template.php
にあります。
最新英語版: WordPress Codex » Function Reference/bloginfo (最新版との差分)