Template Tags/get bloginfo

From 워드프레스(WORDPRESS) 한국어 위키

Jump to: navigation, search

Contents

Description

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

Usage

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

Examples

Default Usage

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'); ?>

Blog Tagline

Using this example:

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

results in this being displayed on your blog:

Your Blog Tagline is: All things WordPress

Template Directory

Returns template directory URL to the active theme. This this example the information is used to include a custom template called searchform.php'.

<?php include(get_bloginfo('template_directory') . '/searchform.php'); ?>

Parameters

show 
(string) Informational detail about your blog. Valid values:
  • '' - (default) returns the Weblog title set in Administration > Options > General. This data is retrieved from the blogname record in the wp_options table.
  • 'name' - returns the same value as '' (the default).
  • 'description' - the Tagline set in Administration > Options > General. This data is retrieved from the blogdescription record in the wp_options table.
  • 'url' - the Blog address (URI) is the URL for your blog's web site address and is set in Administration > Options > General. This data is retrieved from the home record in the wp_options table.
  • 'home' - returns the same value as 'url'.
  • 'site_url' - returns the same value as 'url'.
  • 'wpurl' - the WordPress address (URI) is the URL for your WordPress installation and is set in Administration > Options > General. This data is retrieved from the siteurl record in the wp_options table.
  • 'rdf_url' - URL for RDF/RSS 1.0 feed which is your Blog address (URI) appended with the string such as /feed/rfd.
  • 'rss_url' - URL for RSS 0.92 feed which is your Blog address (URI) appended with the string such as /feed/rss.
  • 'rss2_url' - URL for RSS 2.0 feed which is your Blog address (URI) appended with the string such as /feed.
  • 'atom_url' - URL for Atom feed which is your Blog address (URI) appended with the string such as /feed/atom.
  • 'comments_rss2_url' - URL for comments RSS 2.0 feed which is your Blog address (URI) appended with the string such as /comments/feed.
  • 'pingback_url' - URL for Pingback (XML-RPC file) which is your Blog address (URI) appended with the string /xmlrpc.php.
  • 'stylesheet_url' - URL for primary CSS file which is your Blog address (URI) appended with the string composed of /wp-content/themes plus the value of the stylesheet record in the wp_options table plus the string /style.css. For example, http://www.sample.com/wordpress/wp-content/themes/default/style.css
  • 'stylesheet_directory' - URL for stylesheet directory which is your Blog address (URI) appended with the string composed of /wp-content/themes plus the value of the stylesheet record in the wp_options table. For example, http://www.sample.com/wordpress/wp-content/themes/default.
  • 'template_directory' - URL for template's directory which is your Blog address (URI) appended with the string composed of /wp-content/themes plus the value of the template record in the wp_options table. For example, http://www.sample.com/wordpress/wp-content/themes/default.
  • 'template_url' - the same as 'template_directory' and returns URL for template in use.
  • 'admin_email' - the Administrator's E-mail address set in Administration > Options > General. This data is retrieved from the admin_email record in the wp_options table.
  • 'charset' - the Encoding for pages and feeds set in Administration > Options > Reading. This data is retrieved from the blog_charset record in the wp_options table.
  • 'version' - Version of WordPress your blog uses. This data is the value of $wp_version variable set in wp-includes/version.php.
  • 'html_type' - "Content-type" for your blog. This value is set in wp-admin/upgrade-schema.php and is retrieved from the html_type record in the wp_options table .

Related

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

How to pass parameters to tags

Go to Template Tag index

Personal tools