-
Notifications
You must be signed in to change notification settings - Fork 89
/
theme-options-example.txt
77 lines (69 loc) · 2.05 KB
/
theme-options-example.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Theme Colors and Images Settings Functions file
*
* Below is an example of creating a new tab for your Theme Options page:
$colors_images_tab = array(
"name" => "colors_and_images",
"title" => __("Colors and Images","upfw"),
'sections' => array(
'color_scheme' => array(
'name' => 'color_scheme',
'title' => __( 'Color Scheme', 'upfw' ),
'description' => __( 'Select your color scheme.','upfw' )
)
)
);
register_theme_option_tab($colors_images_tab);
*
* The following example shows you how to register theme options and assign them to tabs:
$options = array(
'theme_color_scheme' => array(
"tab" => "colors_and_images",
"name" => "theme_color_scheme",
"title" => "Theme Color Scheme",
"description" => __( "Select a color scheme for your website", "example" ),
"section" => "color_scheme",
"since" => "1.0",
"id" => "color_scheme",
"type" => "select",
"default" => "light",
"valid_options" => array(
"light" => array(
"name" => "light",
"title" => __( "Light", "example" )
),
"dark" => array(
"name" => "dark",
"title" => __( "Dark", "example" )
)
)
),
"theme_footertext" => array(
"tab" => "colors_and_images",
"name" => "theme_footertext",
"title" => "Theme Footer Text",
"description" => __( "Enter text to be displayed in your footer", "example" ),
"section" => "color_scheme",
"since" => "1.0",
"id" => "color_scheme",
"type" => "text",
"default" => "Copyright 2012 UpThemes"
),
"font_color" => array(
"tab" => "colors_and_images",
"name" => "font_color",
"title" => "Font Color",
"description" => __( "Select a font color for your theme", "example" ),
"section" => "color_scheme",
"since" => "1.0",
"id" => "color_scheme",
"type" => "color",
"default" => "#ffffff"
)
);
register_theme_options($options);
* The different types of options you can define are: text, color, image, select, list, multiple, textarea, page, pages, category, categories
*
*/
?>