WordPress Cheat Sheet / Tags – Part 3 [Blog Info Tags]

Hello Friends

Today we are going to know the BlogInfor Tag of WordPress Theme. So, lets start-

Blog Infobloginfo();

Displays information about your blog, mostly gathered from the information you supply in your User Profile and General Options from the WordPress Administration panels (Settings > General). 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().

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

name

Type: String

Returns the Weblog title set in Administration > Settings > General.


description

Type: String

Returns the Tagline set in Administration > Settings > General.


admin_email

Type: String

Returns the Administrator’s E-mail address set in Administration > Settings > General.


url

Type: String

The Blog address (URI) is the URL for your blog’s web site address and is set in Administration > Settings > General.


wpurl

Type: String

The WordPress address (URI) is the URL for your WordPress installation and is set in Administration > Settings > General


stylesheet_directory

Type: String

Returns URL of the stylesheet directory of the active theme.


stylesheet_url

Type: String

Returns URL for primary CSS file (usually style.css) of the active theme.


template_directory

Type: String

Returns URL of the active theme’s directory. (template_directory was a local path before 2.6; see get_theme_root() and get_template() for hackish alternatives.) Within child themes, both get_bloginfo(“template_url”) and get_template() will return the parent theme directory.


template_url

Type: String

Returns URL of the active theme’s directory. (template_directory was a local path before 2.6; see get_theme_root() and get_template() for hackish alternatives.) Within child themes, both get_bloginfo(“template_url”) and get_template() will return the parent theme directory.


atom_url

Type: String

Returns URL for the blog’s Atom feed.


rss2_url

Type: String

Returns URL for the blog’s RSS 2.0 feed.


rss_url

Type: String

Returns URL for the blog’s RSS 0.92 feed.


pingback_url

Type: String

Returns URL for Pingback XML-RPC file.


rdf_url

Type: String

Returns URL for the blog’s RDF/RSS 1.0 feed.


comments_atom_url

Type: String

Returns URL for the blog’s comments Atom feed.


comments_rss2_url

Type: String

Returns URL for the blog’s comments RSS 2.0 feed.


charset

Type: String

Returns the Encoding for pages and feeds set in Administration > Settings > Reading.


html_type

Type: String

Returns Content-Type of WordPress HTML pages (default: text/html); stored in the html_type record in the wp_options table. Themes and plugins can override the default value by using the pre_option_html_type filter.


language

Type: String

Returns selected language.


text_direction

Type: String

Returns selected direction.


version

Type: String

Returns version of WordPress your blog uses.

Blog Info RSS bloginfo_rss();

Display RSS container for the bloginfo function. You can retrieve anything that you can using the get_bloginfo() function. Everything will be stripped of tags and characters converted, when the values are retrieved for use in the feeds.

<?php bloginfo_rss($show); ?>

$show

Type: String

(Optional) See get_bloginfo() for possible values.

Get Blog Info get_bloginfo();

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

<?php get_bloginfo($show) ?>

$show

Type: String

(Optional) Keyword naming the information you want. Default: name.

If you omit this parameter or pass any value besides those below, the function returns the Weblog title.


name

Type: String

Returns the Weblog title set in Administration > Settings > General.


description

Type: String

Returns the Tagline set in Administration > Settings > General.


url

Type: String

The Blog address (URI) is the URL for your blog’s web site address and is set in Administration > Settings > General.


wpurl

Type: String

The WordPress address (URI) is the URL for your WordPress installation and is set in Administration > Settings > General


rdf_url

Type: String

Returns URL for the blog’s RDF/RSS 1.0 feed.


rss_url

Type: String

Returns URL for the blog’s RSS 0.92 feed.


rss2_url

Type: String

Returns URL for the blog’s RSS 2.0 feed.


atom_url

Type: String

Returns URL for the blog’s Atom feed.


comments_rss2_url

Type: String

Returns URL for the blog’s comments RSS 2.0 feed.


pingback_url

Type: String

Returns URL for Pingback XML-RPC file.


stylesheet_url

Type: String

Returns URL for primary CSS file (usually style.css) of the active theme.


template_directory

Type: String

Returns URL of the active theme’s directory. (template_directory was a local path before 2.6; see get_theme_root() and get_template() for hackish alternatives.) Within child themes, both get_bloginfo(“template_url”) and get_template() will return the parent theme directory.


template_url

Type: String

Returns URL of the active theme’s directory. (template_directory was a local path before 2.6; see get_theme_root() and get_template() for hackish alternatives.) Within child themes, both get_bloginfo(“template_url”) and get_template() will return the parent theme directory.


admin_email

Type: String

Returns the Administrator’s E-mail address set in Administration > Settings > General.


charset

Type: String

Returns the Encoding for pages and feeds set in Administration > Settings > Reading.


version

Type: String

Returns version of WordPress your blog uses.


html_type

Type: String

Returns Content-Type of WordPress HTML pages (default: text/html); stored in the html_type record in the wp_options table. Themes and plugins can override the default value by using the pre_option_html_type filter.

Get Blog Info RSS  get_bloginfo_rss();

RSS container for the bloginfo function. You can retrieve anything that you can using the get_bloginfo() function. Everything will be stripped of tags and characters converted, when the values are retrieved for use in the feeds.

<?php get_bloginfo_rss($show); ?>

$show

Type: String

Informational detail about your blog. Valid values:

  • ‘name’ – Weblog 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.
  • ‘rss_url’ – URL for RSS 0.92 feed.
  • ‘rss2_url’ – URL for RSS 2.0 feed.
  • ‘atom_url’ – URL for Atom feed.
  • ‘comments_rss2_url’ – URL for comments RSS 2.0 feed.
  • ‘pingback_url’ – URL for Pingback (XML-RPC file).
  • ‘admin_email’ – Administrator’s email address; set in General Options.
  • ‘charset’ – Character encoding for your blog; set in Reading Options.
  • ‘version’ – Version of WordPress your blog uses.

The following will work in WordPress version 1.5 or after:

  • ‘html_type’ – “Content-type” for your blog.
  • ‘wpurl’ – URL for WordPress installation.
  • ‘template_url’ – URL for template in use.
  • ‘template_directory’ – URL for template’s directory.
  • ‘stylesheet_url’ – URL for primary CSS file.
  • ‘stylesheet_directory’ – URL for stylesheet directory.

 

I hope, this post will help for you. Thanks to read this post. Keep in touch.
bye for today.

Advertisements

1 Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s