get_bloginfo

Sponsored Link

get_bloginfo()関数は、PHPコードのどの部分でもあなたのブログについての情報を返します。この関数は、bloginfo()と同様に、あなたのブログの情報を表示するために使用することができます。

Sponsored Link

The get_bloginfo() function returns information about your blog which can then be used elsewhere in your PHP code. This function, as well as bloginfo(), can also be used to display your blog information.

get_bloginfoのテンプレートタグ使用方法

<?php $bloginfo = get_bloginfo( $show ); ?> 

get_bloginfoのテンプレートタグ使用方法

$show

(string) (Optional)キーワードには、必要な情報を命名します。

(string) (Optional) Keyword naming the information you want.

デフォルト:name

Default: name

あなたはこのパラメータを省略した場合、またはこれらの下以外の任意の値を渡す場合は、この関数はウェブログタイトルを返す以外の任意の値を渡します。

If you omit this parameter or pass any value besides those below, the function returns the Weblog title.

name

(default)ウェブログのタイトルを返すには、管理→設定→一般的で設定します。このデータは wp_optionsテーブル内のblognameレコードから取得されます。

(default) returns the Weblog title set in Administration → Settings → General. This data is retrieved from the blogname record in the wp_options table.

description

キャッチフレーズは、管理画面→設定→一般から設定します。このデータは、wp_optionsテーブル内のblogdescriptionレコードから取得されます。

the Tagline set in Administration → Settings → General. This data is retrieved from the blogdescription record in the wp_options table.

url

home (deprecated)

siteurl (deprecated)

ブログのアドレス(URI)は、ブログのウェブサイトアドレスをあなたのブログのWebサイトのアドレスのURLです。管理→設定→一般的で設定します。このデータは wp_optionsテーブル内のホームレコードから取得されます。

the Blog address (URI) is the URL for your blog’s web site address and is set in Administration → Settings → General. This data is retrieved from the home record in the wp_options table.

wpurl

WordPressのアドレス(URI)は、WordPressをインストールしたURLであり、管理→設定→一般で設定します。このデータは、wp_optionsテーブル内のsiteurlレコードから取得します。

the WordPress address (URI) is the URL for your WordPress installation and is set in Administration → Settings → General. This data is retrieved from the siteurl record in the wp_options table.

rdf_url

ブログのRDF/RSS 1.0 フィード (/feed/rfd)のURLです。

URL for the blog’s RDF/RSS 1.0 feed (/feed/rfd).

rss_url

ブログのRDF/RSS 0.92 フィード (/feed/rss)のURLです。

URL for the blog’s RSS 0.92 feed (/feed/rss).

rss2_url

ブログのRDF/RSS 2.0 フィード (/feed)のURLです。

URL for the blog’s RSS 2.0 feed (/feed).

atom_url

ブログのAtom フィード (/feed/atom)のURLです。

URL for the blog’s Atom feed (/feed/atom).

comments_rss2_url

ブログのコメントRSS 2.0 フィード (/comments/feed)のURLです。

URL for the blog’s comments RSS 2.0 feed (/comments/feed).

pingback_url

ピングバックのためのURLは、XML-RPC ファイル(xmlrpc.php)です。

URL for Pingback XML-RPC file (xmlrpc.php).

stylesheet_url

有効なテーマの主要なCSSファイル (通常はstyle.css) のURLです。

URL for primary CSS file (usually style.css) of the active theme.

stylesheet_directory

有効なテーマのスタイルシートディレクトリへURLです。(以前のWordPressのバージョンではローカルパスでした。)

URL of the stylesheet directory of the active theme. (Was a local path in earlier WordPress versions.)

template_directory

template_url

有効なテーマのディレクトリーへのURLです。(template_directoryは、2.6以前のローカルパスでした;get_theme_root() と get_template()はハック代替のために参照してください。)

URL of the active theme’s directory. (template_directory was a local path before 2.6; see get_theme_root() and get_template() for hackish alternatives.)

admin_email

管理者の電子メールアドレスは、管理→設定→一般で設定します。このデータは wp_optionsテーブル内のadmin_emailレコードから取得されます。

The Administrator’s E-mail address set in Administration → Settings → General. This data is retrieved from the admin_email record in the wp_options table.

charset

ページとフィードのエンコーディングは、管理画面→設定→表示設定で設定します。このデータはwp_optionsテーブル内のblog_charsetレコードから取得されます。

The Encoding for pages and feeds set in Administration → Settings → Reading. This data is retrieved from the blog_charset record in the wp_options table.

version

ブログで使っているWordPressのバージョンです。このデータは、wp-includes/version.php内で設定されている$wp_version変数の値です。

Version of WordPress your blog uses. This data is the value of $wp_version variable set in wp-includes/version.php.

html_type

WordPressのHTMLページContent-Type(デフォルト:text/html); wp_optionsテーブル内にhtml_typeレコードの中に格納されています。テーマとプラグインはpre_option_html_typeフィルタを使用して、デフォルトの値を上書きする事が出来ます。(pre_option_ filtersの詳細についてはCodexのこのセクションを参照してください)

Content-Type of WordPress HTML pages (default: text/html); stored in the html_type record in the wp_options table. Themes and plugins can override the default value by using the pre_option_html_type filter (see this section of the Codex for more information on pre_option_ filters).

デフォルトの使い方

デフォルトの使用は、変数$blog_titleにあなたのブログのタイトルを割り当てます。

The default usage assigns your blog’s title to the variable $blog_title.

<?php $blog_title = get_bloginfo(); ?>

ブログタイトル

この例では変数$ blog_titleがあなたのブログのタイトルを割り当てます。これはデフォルトの使用方法と同じ結果を返します。

This example assign your blog’s title to the variable $blog_title. This returns the same result as the default usage.

<?php $blog_title = get_bloginfo('name'); ?>

ブログキャッチフレーズ

この例の使い方:

Using this example:

<?php echo 'Your Blog Tagline is: ' . get_bloginfo ( 'description' );  ?><br />

これはあなたのブログに表示される結果:

results in this being displayed on your blog:

Your Blog Tagline is: All things WordPress

テンプレートディレクトリ

有効なテーマにテンプレートディレクトリURLを返します

Returns template directory URL to the active theme.

出力例

2.7バージョンから。ホストの例では、ブログのアドレス(URL)はhttp://example/homeと表示され、WordPressのアドレス(URL)はhttp://example/home/wpでインストールされます。

From version 2.7. On host example, the Blog address (URL) is shown at http://example/home, and the WordPress address (URL) is installed at http://example/home/wp.

そのディレクトリのURLは、末尾のスラッシュ不足しているので注意してください

Note that directory URLs are missing trailing slashes.

admin_email = admin@example
atom_url = http://example/home/feed/atom
charset = UTF-8
comments_atom_url = http://example/home/comments/feed/atom
comments_rss2_url = http://example/home/comments/feed
description = Just another WordPress blog
home = http://example/home
html_type = text/html
language = en-US
name = Testpilot
pingback_url = http://example/home/wp/xmlrpc.php
rdf_url = http://example/home/feed/rdf
rss2_url = http://example/home/feed
rss_url = http://example/home/feed/rss
siteurl = http://example/home
stylesheet_directory = http://example/home/wp/wp-content/themes/largo
stylesheet_url = http://example/home/wp/wp-content/themes/largo/style.css
template_directory = http://example/home/wp/wp-content/themes/largo
template_url = http://example/home/wp/wp-content/themes/largo
text_direction = ltr
url = http://example/home
version = 2.7
wpurl = http://example/home/wp

関連テンプレートタグ

bloginfo()

関連テンプレートタグ

bloginfo, bloginfo_rss, get_bloginfo, get_bloginfo_rss, wp_title, get_archives, wp_get_archives, get_calendar, get_posts, wp_list_pages, wp_dropdown_pages, wp_loginout, wp_register, query_posts, rss_enclosure

Sponsored Link