wordpress教程之blog info tags

作者:  耕堂 | 本文浏览833次 | 2009年08月5日

wordpress模板标签/bloginfo

-描述:
展示博客信息,这些信息大部分来自于wordpress控制面板中的用户配置和常规选项。在一个页面模板中它可以被用于任意地方。它总是向浏览器输出一个结果。

-使用:

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

-例子:
显示博客标题

<h1><?php bloginfo(‘name’); ?></h1>

显示字符设置

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

显示博客描述
展示控制面板中常规选项中的标语

<p><?php bloginfo(‘description’); ?> </p>

-参数:
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

模板标签template tags/bloginfo rss

-描述:
-使用:

<?php bloginfo_rss(’show’); ?>

-例子:
显示博客标题和链接

<title><?php bloginfo_rss(‘name’); ?></title><link><?php bloginfo_rss(‘url’) ?></link>

-参数:
$show
(字符串)关于博客的详细信息。有效值:
* ‘name’ – blog title; set in General Options. (Default)
博客标题,在常规选项里(默认显示)
* ‘description’ – Tagline for your blog; set in General Options.
描述,在常规选项里
* ‘url’ – URL for your blog’s web site address.
博客网站的地址
* ‘rdf_url’ – URL for RDF/RSS 1.0 feed.
rdf/rss1.0地址
* ‘rss_url’ – URL for RSS 0.92 feed.
rss0.92的地址
* ‘rss2_url’ – URL for RSS 2.0 feed.
rss2.0的地址
* ‘atom_url’ – URL for Atom feed.
atom的地址
* ‘comments_rss2_url’ – URL for comments RSS 2.0 feed.
comments RSS 2.0的地址
* ‘pingback_url’ – URL for Pingback (XML-RPC file).
Pingback (XML-RPC file)的地址
* ‘admin_email’ – Administrator’s email address; set in
General Options.
管理员email地址,在常规选项里
* ‘charset’ – Character encoding for your blog; set in Reading Options.
字符编码,在阅读选项里
* ‘version’ – Verson of WordPress your blog uses.
当前wordpress的版本

下面的在1.5或之后版本中可用:
* ‘html_type’ – “Content-type” for your blog.
* ‘wpurl’ – URL for WordPress installation.
wp安装地址
* ‘template_url’ – URL for template in use.
当前模板的地址
* ‘template_directory’ – URL for template’s directory.
模板目录
* ’stylesheet_url’ – URL for primary CSS file.
主要css文件地址
* ’stylesheet_directory’ – URL for stylesheet directory.
样式目录

函数参考/get bloginfo

-描述:
该函数返回博客的信息,可以在PHP代码中用在其他地方。和bloginfo()一样,展示博客信息。

-使用:

<?php get_bloginfo( $show ); ?>
文章分页: 1 2

 右上方更多相关内容/站内搜索-关键词请用空格隔开

  • 标签 :  , , , , ,
  • 原文链接 : http://www.gengtang.net/wordpress/blog-info-tags.html
  • 转载原创文章请注明 : 耕堂-gengtang.net
  • 发表留言

    可用HTML标签:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>