WordPress: Template Tags/bloginfo:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: == Description == Displays information about your blog, mostly gathered from the information you supply in your '''User Profile''' and '''General Options''' from the WordPress '''Adminis...)
 
无编辑摘要
第1行: 第1行:
== Description ==
== 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. 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 [[WordPress:Template Tags/get_bloginfo|get_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. 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 [[WordPress:Template Tags/get_bloginfo|get_bloginfo()]].
显示关于你的博客的信息,这些信息大多数是从WordPress'''管理'''面板,'''用户基本资料'''和 '''总选项'''中,你提供的信息中,收集到的。这些信息可以在网页模板的任何位置使用,通过向浏览器提供结果。如果你需要在PHP中使用参数值,请使用[[WordPress:Template Tags/get_bloginfo|得到_bloginfo()]]。


== Usage ==
== Usage ==
%%% <?php bloginfo('show'); ?> %%%
%%% <?php bloginfo('show'); ?> %%%
== 用法 ==
%%% <?php bloginfo('显示'); ?> %%%


== Examples ==
== Examples ==


=== Show Blog Title ===
=== Show Blog Title ===
== 例子 ==
=== 显示博客标题 ===


Displays your blog's title in a &lt;h1&gt; tag.
Displays your blog's title in a &lt;h1&gt; tag.
在&lt;h1&gt;标签中显示你的博客标题。
&lt;h1&gt;<?php bloginfo('name'); ?>&lt;/h1&gt;


&lt;h1&gt;<?php bloginfo('name'); ?>&lt;/h1&gt;
&lt;h1&gt;<?php bloginfo('name'); ?>&lt;/h1&gt;


=== Show Character Set ===
=== Show Character Set ===
=== 显示字符集===


Displays the character set your blog is using (ex: utf-8)
Displays the character set your blog is using (ex: utf-8)
显示你的博客使用的字符集(例如:utf-8)
&lt;p&gt;Character set: <?php bloginfo('charset'); ?> &lt;/p&gt;


&lt;p&gt;Character set: <?php bloginfo('charset'); ?> &lt;/p&gt;
&lt;p&gt;字符集: <?php bloginfo('charset'); ?> &lt;/p&gt;


===Show Blog Description===
===Show Blog Description===
===显示博客描述===


Displays Tagline for your blog as set in the Administration panel under '''General Options'''.
Displays Tagline for your blog as set in the Administration panel under '''General Options'''.
显示你的博客的Tagline,设置在管理面板中的'''总选项'''下面。


  &lt;p&gt;<?php bloginfo('description'); ?> &lt;/p&gt;
  &lt;p&gt;<?php bloginfo('description'); ?> &lt;/p&gt;
&lt;p&gt;<?php bloginfo('描述'); ?> &lt;/p&gt;


== Parameters ==
== Parameters ==
== 参数 ==


; show : (''string'') Informational detail about your blog. Valid values:
; show : (''string'') Informational detail about your blog. Valid values:
;显示:(''string'')关于你的博客的详细信息。有效的参数值:
:* <tt>'name'</tt> - Weblog title; set in General Options. (Default)
:* <tt>'name'</tt> - Weblog title; set in General Options. (Default)
:* <tt>'名称'</tt> -网络日志标题;设置在总选项中。(默认)
:* <tt>'description'</tt> - Tagline for your blog; set in General Options.
:* <tt>'description'</tt> - Tagline for your blog; set in General Options.
:* <tt>'描述'</tt> -你的博客的tagline;设置在总选项中。
:* <tt>'url'</tt> - [[WordPress:Glossary#URI and URL|URL]] for your blog's web site address.
:* <tt>'url'</tt> - [[WordPress:Glossary#URI and URL|URL]] for your blog's web site address.
:* <tt>'url'</tt> -你的博客的网站地址的[[WordPress:Glossary#URI and URL|URL]]。
:* <tt>'rdf_url'</tt> - URL for [[WordPress:Glossary#RDF|RDF]]/RSS 1.0 feed.
:* <tt>'rdf_url'</tt> - URL for [[WordPress:Glossary#RDF|RDF]]/RSS 1.0 feed.
:* <tt>'rdf_url'</tt> -[[WordPress:Glossary#RDF|RDF]]/RSS 1.0 feed的URL。
:* <tt>'rss_url'</tt> - URL for [[WordPress:Glossary#RSS|RSS]] 0.92 feed.
:* <tt>'rss_url'</tt> - URL for [[WordPress:Glossary#RSS|RSS]] 0.92 feed.
:* <tt>'rss_url'</tt> -[[WordPress:Glossary#RSS|RSS]] 0.92 feed的URL。
:* <tt>'rss2_url'</tt> - URL for RSS 2.0 feed.
:* <tt>'rss2_url'</tt> - URL for RSS 2.0 feed.
:* <tt>'rss2_url'</tt> - RSS 2.0 feed的URL。
:* <tt>'atom_url'</tt> - URL for [[WordPress:Glossary#Atom|Atom]] feed.
:* <tt>'atom_url'</tt> - URL for [[WordPress:Glossary#Atom|Atom]] feed.
:* <tt>'atom_url'</tt> -[[WordPress:Glossary#Atom|Atom]] feed的URL。
:* <tt>'comments_rss2_url'</tt> - URL for comments RSS 2.0 feed.
:* <tt>'comments_rss2_url'</tt> - URL for comments RSS 2.0 feed.
:* <tt>'评论_rss2_url'</tt> -评论RSS 2.0 feed的URL。
:* <tt>'pingback_url'</tt> - URL for [[WordPress:Glossary#PingBack|Pingback]] (XML-RPC file).
:* <tt>'pingback_url'</tt> - URL for [[WordPress:Glossary#PingBack|Pingback]] (XML-RPC file).
:* <tt>'pingback_url'</tt> -[[WordPress:Glossary#PingBack|Pingback]] (XML-RPC 文件)的URL。
:* <tt>'admin_email'</tt> - Administrator's email address; set in General Options.
:* <tt>'admin_email'</tt> - Administrator's email address; set in General Options.
:* <tt>'管理_电子邮件'</tt> -管理员的电子邮件地址;设置在一般选项中。
:* <tt>'charset'</tt> - Character encoding for your blog; set in Reading Options.
:* <tt>'charset'</tt> - Character encoding for your blog; set in Reading Options.
:* <tt>'charset'</tt> -你的博客的字符编码;设置在阅读选项中。
:* <tt>'version'</tt> - Version of WordPress your blog uses.
:* <tt>'version'</tt> - Version of WordPress your blog uses.
:* <tt>'版本'</tt> -你的博客使用的WordPress版本。
:* <tt>'text_direction'</tt> - Returns 'rtl' for right to left or 'ltr' for left to right (Default).
:* <tt>'text_direction'</tt> - Returns 'rtl' for right to left or 'ltr' for left to right (Default).
:* <tt>'文本_方向'</tt> -从右到左,返回'rtl',从左到右返回'ltr'(默认)。


: '''The following work in WordPress version 1.5 or after:'''
: '''The following work in WordPress version 1.5 or after:'''
: '''下面的,在WordPress1.5版本或者以后的版本中运行::'''
:* <tt>'html_type'</tt> - "Content-type" for your blog.
:* <tt>'html_type'</tt> - "Content-type" for your blog.
:* <tt>'html_类型'</tt> -你的博客的 "内容类型" 。
:* <tt>'wpurl'</tt> - URL for WordPress installation.
:* <tt>'wpurl'</tt> - URL for WordPress installation.
:* <tt>'wpurl'</tt> -WordPress安装的URL。
:* <tt>'template_url'</tt> - URL for template in use.
:* <tt>'template_url'</tt> - URL for template in use.
:* <tt>'模板_url'</tt> -使用的模板的URL。
:* <tt>'template_directory'</tt> -  URL for template's directory.
:* <tt>'template_directory'</tt> -  URL for template's directory.
:* <tt>'模板_目录'</tt> -模板的目录的URL。
:* <tt>'stylesheet_url'</tt> - URL for primary [[WordPress:Glossary#CSS|CSS]] file. Returns: http//example.com/wp-content/themes/ + your-active-theme-name(value from wp_options, "stylesheet" row)  + "/style.css"(hardcoded in wp-includes/theme.php)
:* <tt>'stylesheet_url'</tt> - URL for primary [[WordPress:Glossary#CSS|CSS]] file. Returns: http//example.com/wp-content/themes/ + your-active-theme-name(value from wp_options, "stylesheet" row)  + "/style.css"(hardcoded in wp-includes/theme.php)
:* <tt>'样式表_url'</tt> -主要的[[WordPress:Glossary#CSS|CSS]]文件的URL。返回:http//example.com/wp-content/themes/ + your-active-theme-name(来自wp_选项的参数值, "样式表" 排)  + "/style.css"(hardcoded in wp-includes/theme.php)


=== Deprecated Parameters ===
=== Deprecated Parameters ===
=== 取消的参数 ===


* <tt>'stylesheet_directory'</tt> - URL for stylesheet directory. (Deprecated in 2.3.1)
* <tt>'stylesheet_directory'</tt> - URL for stylesheet directory. (Deprecated in 2.3.1)
* <tt>'样式表_目录'</tt> - 样式表目录的URL。 (2.3.1版本中这个已经取消了)


== Related ==
== Related ==
第61行: 第150行:


[[WordPress:Category:Template Tags]]
[[WordPress:Category:Template Tags]]
== 相关的 ==
{{标签 一般标签}}
{{标签 页底文字}}
[[WordPress:Category:Template Tags|类别:模板标签]]

2008年7月2日 (三) 17:33的版本

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. 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().

显示关于你的博客的信息,这些信息大多数是从WordPress管理面板,用户基本资料总选项中,你提供的信息中,收集到的。这些信息可以在网页模板的任何位置使用,通过向浏览器提供结果。如果你需要在PHP中使用参数值,请使用得到_bloginfo()

Usage

%%% <?php bloginfo('show'); ?> %%%

用法

%%% <?php bloginfo('显示'); ?> %%%

Examples

Show Blog Title

例子

显示博客标题

Displays your blog's title in a <h1> tag. 在<h1>标签中显示你的博客标题。

<h1><?php bloginfo('name'); ?></h1>

<h1><?php bloginfo('name'); ?></h1>

Show Character Set

显示字符集

Displays the character set your blog is using (ex: utf-8) 显示你的博客使用的字符集(例如:utf-8)

<p>Character set: <?php bloginfo('charset'); ?> </p>

<p>字符集: <?php bloginfo('charset'); ?> </p>

Show Blog Description

显示博客描述

Displays Tagline for your blog as set in the Administration panel under General Options.

显示你的博客的Tagline,设置在管理面板中的总选项下面。

<p><?php bloginfo('description'); ?> </p>

<p><?php bloginfo('描述'); ?> </p>

Parameters

参数

show
(string) Informational detail about your blog. Valid values:

;显示:(string)关于你的博客的详细信息。有效的参数值:

  • 'name' - Weblog title; set in General Options. (Default)
  • '名称' -网络日志标题;设置在总选项中。(默认)
  • 'description' - Tagline for your blog; set in General Options.
  • '描述' -你的博客的tagline;设置在总选项中。
  • 'url' - URL for your blog's web site address.
  • 'url' -你的博客的网站地址的URL
  • 'rdf_url' - URL for RDF/RSS 1.0 feed.
  • 'rdf_url' -RDF/RSS 1.0 feed的URL。
  • 'rss_url' - URL for RSS 0.92 feed.
  • 'rss_url' -RSS 0.92 feed的URL。
  • 'rss2_url' - URL for RSS 2.0 feed.
  • 'rss2_url' - RSS 2.0 feed的URL。
  • 'atom_url' - URL for Atom feed.
  • 'atom_url' -Atom feed的URL。
  • 'comments_rss2_url' - URL for comments RSS 2.0 feed.
  • '评论_rss2_url' -评论RSS 2.0 feed的URL。
  • 'pingback_url' - URL for Pingback (XML-RPC file).
  • 'pingback_url' -Pingback (XML-RPC 文件)的URL。
  • 'admin_email' - Administrator's email address; set in General Options.
  • '管理_电子邮件' -管理员的电子邮件地址;设置在一般选项中。
  • 'charset' - Character encoding for your blog; set in Reading Options.
  • 'charset' -你的博客的字符编码;设置在阅读选项中。
  • 'version' - Version of WordPress your blog uses.
  • '版本' -你的博客使用的WordPress版本。
  • 'text_direction' - Returns 'rtl' for right to left or 'ltr' for left to right (Default).
  • '文本_方向' -从右到左,返回'rtl',从左到右返回'ltr'(默认)。
The following work in WordPress version 1.5 or after:


下面的,在WordPress1.5版本或者以后的版本中运行::


  • 'html_type' - "Content-type" for your blog.
  • 'html_类型' -你的博客的 "内容类型" 。
  • 'wpurl' - URL for WordPress installation.
  • 'wpurl' -WordPress安装的URL。
  • 'template_url' - URL for template in use.
  • '模板_url' -使用的模板的URL。
  • 'template_directory' - URL for template's directory.
  • '模板_目录' -模板的目录的URL。
  • 'stylesheet_url' - URL for primary CSS file. Returns: http//example.com/wp-content/themes/ + your-active-theme-name(value from wp_options, "stylesheet" row) + "/style.css"(hardcoded in wp-includes/theme.php)
  • '样式表_url' -主要的CSS文件的URL。返回:http//example.com/wp-content/themes/ + your-active-theme-name(来自wp_选项的参数值, "样式表" 排) + "/style.css"(hardcoded in wp-includes/theme.php)

Deprecated Parameters

取消的参数

  • 'stylesheet_directory' - URL for stylesheet directory. (Deprecated in 2.3.1)
  • '样式表_目录' - 样式表目录的URL。 (2.3.1版本中这个已经取消了)

Related

模板:Tag General Tags

模板:Tag Footer

WordPress:Category:Template Tags


相关的

模板:标签 一般标签

类别:模板标签