模板标签-bloginfo()

0条评论

说明

该标签显示用户博客的相关信息,这些信息通常来自用户在WordPress网站后台“我的配置”和“设置>常规”菜单中填写的内容。该标签可以用在页面模板的任何区域内,且该标签总是将结果输出给浏览器。如果用户需要将输出内容用在PHP中,请使用get_bloginfo()

用法

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

示例

显示博客标题

在<h1>标签中显示博客标题

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

显示字符集

显示用户博客所使用的字符集(如:utf-8)

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

显示博客说明

显示用户在设置>常规中设定的博客标语

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

参数

注意其中的目录URL中没有结尾斜线。

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
url = 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
version = 2.7
wpurl = http://example/home/wp

相关资源

get_bloginfo()

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.