WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get settings


This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use any of these functions instead.

Description

A safe way of getting values for a named option from the options database table.

Note

For a complete list of all options available through this function, go to

http://www.yoursite.com/wp-admin/options.php

Also: You can modify any/all of the options from the same page.

Aliases

 get_option($optionname)  This is a wrapper around the get_settings function, added for readability and a more humane interface.

Usage

 <?php echo get_settings('show'); ?>  or  <?php echo get_option('show'); ?> 

Examples

Show Blog Title

Displays your blog's title in a <h1> tag.

 <h1><?php echo get_settings('blogname'); ?></h1>  or  <h1><?php echo get_option('blogname'); ?></h1> 

Show Character Set

Displays the character set your blog is using (ex: UTF-8)  <p>Character set: <?php echo get_settings('blog_charset'); ?> </p>  or  <p>Character set: <?php echo get_option('blog_charset'); ?> </p> 

Retrieve Administrator E-mail

Retrieve the e-mail of the blog administrator, storing it in a variable. <?php $admin_email get_settings('admin_email'); ?> or  <?php $admin_email get_option('admin_email'); ?> 

Parameters

show 
(string) Name of the option. Underscores separate words, lowercase only - this is going to be in a database. Valid values:
  • 'admin_email' - E-mail address of blog administrator.
  • 'blogname' - Weblog title; set in General Options.
  • 'blogdescription' - Tagline for your blog; set in General Options.
  • 'blog_charset' - Character encoding for your blog; set in Reading Options.
  • 'date_format' - Default date format; set in General Options.
  • 'default_category' - Default post category; set in Writing Options.
  • 'home' - The blog's home web address; set in General Options.
  • 'siteurl' - WordPress web address; set in General Options.
    Warning: This is not the same as get_bloginfo('siteurl'); which will return the homepage url. Use get_bloginfo('wpurl'), get_settings() has been deprecated.
  • 'template' - The current theme's name; set in Presentation.
  • 'start_of_week' - Day of week calendar should start on; set in General Options.
  • 'upload_path' - Default upload location; set in Miscellaneous Options.
  • 'posts_per_page' - Maximum number of posts to show on a page; set in Reading Options.
  • 'posts_per_rss' - Maximum number of most recent posts to show in the syndication feed; set in Reading Options.
There are many more options available, a lot of which depend on what plugins you have installed. Visit the /wp-admin/options.php page for a complete list.

Related

See also index of Function Reference and index of Template Tags.