- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
カスタム背景
提供: WordPress Codex 日本語版
2012年5月16日 (水) 00:34時点におけるBono (トーク | 投稿記録)による版 (en:Custom Backgrounds 2012-05-15T15:27:48 Bono 版を翻訳用にコピー)
このページ「カスタム背景」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています。
Custom Backgrounds is a theme feature that provides for customization of the background color and image.
See also Appearance Background Screen.
Adding Theme Support
Since Version 3.4, themes need to use add_theme_support() in the functions.php file to supports custom backgrounds, like so:
add_theme_support( 'custom-background' );
Note that you can add default arguments using:
$defaults = array( 'default-color' => '', 'default-image' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support( 'custom-background', $defaults );
Example
An example using default '#000000' background color with 'background.jpg' background image:
$args = array( 'default-color' => '000000', 'default-image' => get_template_directory_uri() . '/images/background.jpg', ); add_theme_support( 'custom-background', $args );
Related
テーマサポート:
add_theme_support(),
remove_theme_support(),
current_theme_supports()
テーマ機能:
サイドバー,
ナビゲーションメニュー,
投稿フォーマット,
投稿サムネイル,
カスタム背景,
カスタムヘッダー,
自動フィードリンク,
html5,
コンテンツ幅,
editor-style