描述
bloginfo用来显示博客信息,信息通常是用户在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>
参数
-
显示
-
(string) 博客详细信息。有效值(Valid values):
-
'name' - 博客标题; 在常规选项中设置。 (默认)
-
'description' - 博客描述; 在常规选项中设置。
-
'url' - URL 博客地址。
-
'rdf_url' - RDF/RSS 1.0 feed的URL
-
'rss_url' - RSS 0.92 feed的 URL
-
'rss2_url' -RSS 2.0 feed的 URL
-
'atom_url' - Atom feed的URL
-
'comments_rss2_url' - 评论RSS 2.0 feed的URL
-
'pingback_url' - Pingback的(XML-RPC 文件)URL
-
'admin_email' -管理员的邮件地址。在常规选项中设置。
-
'charset' - 博客的字符集;在阅读选项中设置。
-
'version' - WordPress的版本号
-
'text_direction' - 从右至左 'rtl' 或从左至右 'ltr' (默认) 显示博客。
-
以下适用于WordPress1.5或更高版本:
-
'comments_atom_url' - 评论 Atom 1.0 feed的URL
-
'html_type' - 博客的"Content-type" (内容类型)
-
'language' - 博客当前使用的语言编码
-
'wpurl' -WordPress安装文件的URL
-
'template_url' - 当前所用模板的URL
-
'template_directory' - 模板目录的URL
-
'stylesheet_url' -主要的CSS文件的URL。 返回: http//example.com/wp-content/themes/ + your-active-theme-name(value from wp_options, "stylesheet" row) + "/style.css"(wp-includes/theme.php中的硬码)
过时参数
-
'stylesheet_directory' - 样式表目录的URL (在2.3.1版本过时)
最新评论
5 年 11 周之前
5 年 11 周之前
5 年 11 周之前
5 年 11 周之前
5 年 11 周之前
5 年 11 周之前
5 年 12 周之前
5 年 12 周之前
5 年 12 周之前
5 年 12 周之前