WordPress 中文文档

Function Reference/get option

From WordPress Chinese

Jump to: navigation, search

目录

Description

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

Usage

%%% <?php echo get_option('show'); ?> %%%

Examples

Show Blog Title

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

%%%

<?php echo get_option('blogname'); ?>

%%%

Show Character Set

Displays the character set your blog is using (ex: UTF-8)

%%%

Character set: <?php echo get_option('blog_charset'); ?>

%%%

Retrieve Administrator E-mail

Retrieve the e-mail of the blog administrator, storing it in a variable.

%%% <?php $admin_email = get_option('admin_email'); ?> %%%

Parameters

Template:Parameter

Related

Template:Tag General Tags

Template:Tag Footer

用户