Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 598 lines (553 sloc) 19.738 kb
256ad86 Tyler Longren Add initial theme options page. Mostly to enable/disable the "back to to...
authored
1 <?php
b2787d2 Tyler Longren Use wp_enqueue_scripts() to add styles instead of wp_print_styles(). See...
authored
2 /**
3 * Returns the default options for HTML5Press
4 */
5 function html5press_get_default_options() {
6 return array(
7 'back_to_top' => true,
8 'show_tagline' => true,
9 'enable_slimbox' => false,
10 'show_query_stats' => false,
11 'fuzzy_timestamps' => false,
12 'maintenance_mode' => false,
13 'custom_logo_url' => '',
14 'featured_image_size' => 'large',
15 'theme_color' => 'pink',
16 'theme_font' => 'droid-serif',
17 'featured_cat' => '',
18 'num_featured' => '5',
19 'custom_css' => '',
20 'homepage_article_summary' => false
21 );
22 }
23
24 /**
25 * Returns the options array for HTML5Press.
26 */
27 function html5press_get_options() {
28 return get_option( 'html5press_options', html5press_get_default_options() );
29 }
30
31
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
32 if ( is_admin() ) : // Load only if we are viewing an admin page
33
34 function html5press_register_settings() {
35 // Register settings and call sanitation functions
36 register_setting( 'html5press_theme_options', 'html5press_options', 'html5press_validate_options' );
256ad86 Tyler Longren Add initial theme options page. Mostly to enable/disable the "back to to...
authored
37 }
38
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
39 add_action( 'admin_init', 'html5press_register_settings' );
40
d97ab85 Tyler Longren Add option to set size of image that's linked to from featured images.
authored
41 // Store image sizes in array
42 $html5press_image_sizes = array(
43 'full' => array(
44 'value' => 'full',
45 'label' => 'Full'
46 ),
47 'large' => array(
48 'value' => 'large',
49 'label' => 'Large'
50 ),
51 'medium' => array(
52 'value' => 'medium',
53 'label' => 'Medium'
54 ),
55 'thumbnail' => array(
56 'value' => 'thumbnail',
57 'label' => 'Thumbnail'
58 )
59 );
60
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
61 // Store categories in array
62 $html5press_categories[0] = array(
63 'value' => 0,
64 'label' => ''
65 );
66 $html5press_cats = get_categories(); $i = 1;
67 foreach( $html5press_cats as $html5press_cat ) :
68 $html5press_categories[$html5press_cat->cat_ID] = array(
69 'value' => $html5press_cat->cat_ID,
70 'label' => $html5press_cat->cat_name
71 );
72 $i++;
73 endforeach;
57f0b62 Tyler Longren Allow users to use all categories in the featured post slider instead of...
authored
74 $html5press_categories[10000] = array(
75 'value' => 10000,
76 'label' => 'All Categories'
77 );
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
78
79 // Store number of featured posts to show options
80 $html5press_num_featured_options = array(
369cf58 Tyler Longren Fix issue #8, courtesy of adeptris (http://profiles.wordpress.org/users/...
authored
81 '5' => array(
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
82 'value' => '5',
83 'label' => '5'
84 ),
369cf58 Tyler Longren Fix issue #8, courtesy of adeptris (http://profiles.wordpress.org/users/...
authored
85 '10' => array(
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
86 'value' => '10',
87 'label' => '10'
88 ),
369cf58 Tyler Longren Fix issue #8, courtesy of adeptris (http://profiles.wordpress.org/users/...
authored
89 '15' => array(
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
90 'value' => '15',
91 'label' => '15'
92 ),
369cf58 Tyler Longren Fix issue #8, courtesy of adeptris (http://profiles.wordpress.org/users/...
authored
93 '20' => array(
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
94 'value' => '20',
95 'label' => '20'
96 )
97 );
98
f2dfcc7 Tyler Longren Add stylesheet chooser to options and include that stylesheet when loadi...
authored
99 // Store stylesheet choices in an array
100 $html5press_theme_colors = array(
101 'pink' => array(
102 'value' => 'pink',
103 'label' => 'Pink'
104 ),
2224ba2 Tyler Longren Update order of color schemes.
authored
105 'black' => array(
106 'value' => 'black',
107 'label' => 'Black'
108 ),
109 'blue' => array(
110 'value' => 'blue',
111 'label' => 'Blue'
112 ),
0e0efae Tyler Longren Rename the old blue color scheme to "bluish purple" and add another colo...
authored
113 'bluishpurple' => array(
114 'value' => 'bluishpurple',
115 'label' => 'Bluish Purple'
f2dfcc7 Tyler Longren Add stylesheet chooser to options and include that stylesheet when loadi...
authored
116 ),
117 'green' => array(
118 'value' => 'green',
119 'label' => 'Green'
120 ),
4ac95dd Tyler Longren Add light blue, orange, and yellow color options.
authored
121 'orange' => array(
122 'value' => 'orange',
123 'label' => 'Orange'
0e0efae Tyler Longren Rename the old blue color scheme to "bluish purple" and add another colo...
authored
124 ),
2224ba2 Tyler Longren Update order of color schemes.
authored
125 'red' => array(
126 'value' => 'red',
127 'label' => 'Red'
128 )
f2dfcc7 Tyler Longren Add stylesheet chooser to options and include that stylesheet when loadi...
authored
129 );
130
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
131 // Store font choices in an array
132 $html5press_theme_fonts = array(
133 'droid-serif' => array(
134 'value' => 'droid-serif',
135 'label' => 'Droid Serif'
136 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
137 'abel' => array(
138 'value' => 'abel',
139 'label' => 'Abel'
140 ),
141 'aclonica' => array(
142 'value' => 'aclonica',
143 'label' => 'Aclonica'
144 ),
145 'allerta' => array(
146 'value' => 'allerta',
147 'label' => 'Allerta'
148 ),
149 'amaranth' => array(
150 'value' => 'amaranth',
151 'label' => 'Amaranth'
152 ),
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
153 'antic' => array(
154 'value' => 'antic',
155 'label' => 'Antic'
156 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
157 'architects-daughter' => array(
158 'value' => 'architects-daughter',
159 'label' => 'Architects Daughter'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
160 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
161 'cabin' => array(
162 'value' => 'cabin',
163 'label' => 'Cabin'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
164 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
165 'calligraffitti' => array(
166 'value' => 'calligraffitti',
167 'label' => 'Calligraffitti'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
168 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
169 'carter-one' => array(
170 'value' => 'carter-one',
171 'label' => 'Carter One'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
172 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
173 'cherry-cream-soda' => array(
174 'value' => 'cherry-cream-soda',
175 'label' => 'Cherry Cream Soda'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
176 ),
177 'comfortaa' => array(
178 'value' => 'comfortaa',
179 'label' => 'Comfortaa'
180 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
181 'coming-soon' => array(
182 'value' => 'coming-soon',
183 'label' => 'Coming Soon'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
184 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
185 'days-one' => array(
186 'value' => 'days-one',
187 'label' => 'Days One'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
188 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
189 'give-you-glory' => array(
190 'value' => 'give-you-glory',
191 'label' => 'Give You Glory'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
192 ),
193 'gloria-hallelujah' => array(
194 'value' => 'gloria-hallelujah',
195 'label' => 'Gloria Hallelujah'
196 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
197 'hammersmith-one' => array(
198 'value' => 'hammersmith-one',
199 'label' => 'Hammersmith One'
200 ),
201 'im-fell-great-primer-sc' => array(
202 'value' => 'im-fell-great-primer-sc',
203 'label' => 'IM Fell Great Primer SC'
204 ),
205 'istok-web' => array(
206 'value' => 'istok-web',
207 'label' => 'Istok Web'
208 ),
209 'julee' => array(
210 'value' => 'julee',
211 'label' => 'Julee'
212 ),
213 'jura' => array(
214 'value' => 'jura',
215 'label' => 'Jura'
216 ),
217 'just-another-hand' => array(
218 'value' => 'just-another-hand',
219 'label' => 'Just Another Hand'
220 ),
221 'lobster-two' => array(
222 'value' => 'lobster-two',
223 'label' => 'Lobster Two'
224 ),
225 'neucha' => array(
226 'value' => 'neucha',
227 'label' => 'Neucha'
228 ),
229 'news-cycle' => array(
230 'value' => 'news-cycle',
231 'label' => 'News Cycle'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
232 ),
233 'nothing-you-could-do' => array(
234 'value' => 'nothing-you-could-do',
235 'label' => 'Nothing You Could Do'
236 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
237 'numans' => array(
238 'value' => 'numans',
239 'label' => 'Numans'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
240 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
241 'nunito' => array(
242 'value' => 'nunito',
243 'label' => 'Nunito'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
244 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
245 'patrick-hand' => array(
246 'value' => 'patrick-hand',
247 'label' => 'Patrick Hand'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
248 ),
249 'pt-sans-narrow' => array(
250 'value' => 'pt-sans-narrow',
251 'label' => 'PT Sans Narrow'
252 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
253 'quattrocento-sans' => array(
254 'value' => 'quattrocento-sans',
255 'label' => 'Quattrocento Sans'
256 ),
257 'questrial' => array(
258 'value' => 'questrial',
259 'label' => 'Questrial'
260 ),
261 'rationale' => array(
262 'value' => 'rationale',
263 'label' => 'Rationale'
264 ),
265 'redressed' => array(
266 'value' => 'redressed',
267 'label' => 'Redressed'
268 ),
269 'reenie-beanie' => array(
270 'value' => 'reenie-beanie',
271 'label' => 'Reenie Beanie'
272 ),
273 'rochester' => array(
274 'value' => 'rochester',
275 'label' => 'Rochester'
276 ),
277 'rock-salt' => array(
278 'value' => 'rock-salt',
279 'label' => 'Rock Salt'
280 ),
281 'short-stack' => array(
282 'value' => 'short-stack',
283 'label' => 'Short Stack'
284 ),
285 'smythe' => array(
286 'value' => 'smythe',
287 'label' => 'Smythe'
288 ),
289 'sue-ellen-francisco' => array(
290 'value' => 'sue-ellen-francisco',
291 'label' => 'Sue Ellen Francisco'
292 ),
02504df Tyler Longren Add Terminal Dosis google web font.
authored
293 'terminal-dosis' => array(
294 'value' => 'terminal-dosis',
295 'label' => 'Terminal Dosis'
296 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
297 'varela-round' => array(
298 'value' => 'varela-round',
299 'label' => 'Varela Round'
300 ),
301 'vibur' => array(
302 'value' => 'vibur',
303 'label' => 'Vibur'
304 ),
305 'volkhov' => array(
306 'value' => 'volkhov',
307 'label' => 'Volkhov'
308 ),
309 'voltaire' => array(
310 'value' => 'voltaire',
311 'label' => 'Voltaire'
312 ),
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
313 'walter-turncoat' => array(
314 'value' => 'walter-turncoat',
315 'label' => 'Walter Turncoat'
316 ),
c9d81d4 Tyler Longren Add 25 more Google Web Fonts.
authored
317 'yellowtail' => array(
318 'value' => 'yellowtail',
319 'label' => 'Yellowtail'
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
320 )
321 );
322
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
323 function html5press_theme_options() {
324 // Add theme options page to the addmin menu
846370c Tyler Longren Use get_template_directory_uri() instead of get_stylesheet_directory_uri...
authored
325 add_menu_page( 'HTML5Press', 'HTML5Press', 'edit_theme_options', 'theme_options', 'html5press_theme_options_page',get_template_directory_uri() . '/images/html5.png' );
751c45b Tyler Longren Give HTML5Press it's own top level menu in the dashboard and also on the...
authored
326 add_submenu_page( 'theme_options', 'HTML5Press Notes', 'Notes', 'edit_theme_options', 'theme_options_notes', 'html5press_theme_notes_page');
256ad86 Tyler Longren Add initial theme options page. Mostly to enable/disable the "back to to...
authored
327 }
328
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
329 add_action( 'admin_menu', 'html5press_theme_options' );
330
751c45b Tyler Longren Give HTML5Press it's own top level menu in the dashboard and also on the...
authored
331 // Function for notes page
332 function html5press_theme_notes_page() {
333 echo '<div class="wrap">';
334 screen_icon();
335 echo '<h2>HTML5Press Notes</h2><ol>
336 <li><strong>Archive Page:</strong> There\'s a page template called Archives. Don\'t enter any page content, just title the page and select Archives for the page template. The archives will be generated automatically. See <a href="http://html5press.com/archives/">here for an example</a>.</li>
337 <li><strong>Link Post Format:</strong> To utilize the link Post Format, simply write a new post and select "Link" for the format. You\'ll also need to add a custom field with the URL you want to link to. The custom field name should be LinkFormatURL and the custom field value should be the URL you want to link to.</li>
338 <li><strong>Quote Post Format:</strong> When using this post format, I usually use the author or source as the post title, and then put the quote inside a blockquote for the actual post content.</li>
339 <li><strong>Status Post Format:</strong> Just put your status as the post title and publish (make sure you select the status format!). No post content is necessary.</li>
340 <li><strong>Maintenance Mode:</strong> This option lets you show a "maintenance" message to visitors who aren\'t logged in. This can be useful while making changes to your website or while tinkering with HTML5Press. Just don\'t forget to disable it when you\'re done or your visitors won\'t see your site!</li>
2da1d06 Tyler Longren Explain fuzzy timestamps and the twitter widget in HTML5Press notes, and...
authored
341 <li><strong>Fuzzy Timestamps:</strong> Enabling fuzzy timestamps on the options page will cause dates/times to display like "two days ago" or "4 hours ago", instead of dates showing "10/07/2011 11:23:34".</li>
342 <li><strong>Twitter Widget:</strong> A custom twitter widget is included with HTML5Press as of version 2.1. This widget is based on the <a href="https://github.com/matthiassiegel/Simple-Twitter-Widget" target="_blank">Simple Twitter Widget</a> by <a href="http://chipsandtv.com" target="_blank">Matthias Siegel</a>. Matthias graciously allowed me to include his code in HTML5Press.</li>
751c45b Tyler Longren Give HTML5Press it's own top level menu in the dashboard and also on the...
authored
343 </ol></div>';
344 }
345
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
346 // Function to generate options page
347 function html5press_theme_options_page() {
4e6cd61 Tyler Longren Remove references to old settings array.
authored
348 global $html5press_image_sizes, $html5press_categories, $html5press_num_featured_options, $html5press_theme_colors, $html5press_theme_fonts;
256ad86 Tyler Longren Add initial theme options page. Mostly to enable/disable the "back to to...
authored
349
350 if ( ! isset( $_REQUEST['settings-updated'] ) )
d97ab85 Tyler Longren Add option to set size of image that's linked to from featured images.
authored
351 $_REQUEST['settings-updated'] = false; ?>
256ad86 Tyler Longren Add initial theme options page. Mostly to enable/disable the "back to to...
authored
352
353 <div class="wrap">
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
354
e0bcaa0 Tyler Longren Add missing text domain.
authored
355 <?php screen_icon(); echo "<h2>" . get_current_theme() . __( ' Theme Options','html5press' ) . "</h2>"; ?>
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
356
357 <?php if ( false !== $_REQUEST['settings-updated'] ) : ?>
358 <div class="updated fade"><p><strong><?php _e( 'Options saved', 'html5press' ); ?></strong></p></div>
359 <?php endif; ?>
360
361 <form method="post" action="options.php">
362
4e6cd61 Tyler Longren Remove references to old settings array.
authored
363 <?php $options = html5press_get_options(); ?>
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
364
365 <?php settings_fields( 'html5press_theme_options' ); ?>
366
367 <table class="form-table">
368
cc3372e Tyler Longren Add missing label.
authored
369 <tr valign="top"><th scope="row"><label for="back_to_top">"Back to Top" Button</label></th>
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
370 <td>
4e6cd61 Tyler Longren Remove references to old settings array.
authored
371 <input type="checkbox" id="back_to_top" name="html5press_options[back_to_top]" value="1" <?php checked( true, $options['back_to_top'] ); ?> />
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
372 <label for="back_to_top">Enabled</label>
373 </td>
374 </tr>
f033f6d Tyler Longren Add option for infinite scrolling!
authored
375 <tr valign="top"><th scope="row"><label for="infinite_scroll">Infinite Scrolling</label></th>
376 <td>
4e6cd61 Tyler Longren Remove references to old settings array.
authored
377 <input type="checkbox" id="infinite_scroll" name="html5press_options[infinite_scroll]" value="1" <?php checked( true, $options['infinite_scroll'] ); ?> />
f033f6d Tyler Longren Add option for infinite scrolling!
authored
378 <label for="infinite_scroll">Enabled</label>
379 </td>
380 </tr>
87a8a2d Tyler Longren Add option to disable the tagline from showing in the header.
authored
381 <tr valign="top"><th scope="row"><label for="show_tagline">Show Tagline In Header</label></th>
382 <td>
4e6cd61 Tyler Longren Remove references to old settings array.
authored
383 <input type="checkbox" id="show_tagline" name="html5press_options[show_tagline]" value="1" <?php checked( true, $options['show_tagline'] ); ?> />
87a8a2d Tyler Longren Add option to disable the tagline from showing in the header.
authored
384 <label for="show_tagline">Enabled</label>
385 </td>
386 </tr>
acc2e69 Tyler Longren Add slimbox2 to HTML5Press. It's disabled by default, but can be turned ...
authored
387 <tr valign="top"><th scope="row"><label for="enable_slimbox">Slimbox2 Image Overlay</label></th>
388 <td>
4e6cd61 Tyler Longren Remove references to old settings array.
authored
389 <input type="checkbox" id="enable_slimbox" name="html5press_options[enable_slimbox]" value="1" <?php checked( true, $options['enable_slimbox'] ); ?> />
acc2e69 Tyler Longren Add slimbox2 to HTML5Press. It's disabled by default, but can be turned ...
authored
390 <label for="enable_slimbox">Enabled</label>
391 </td>
392 </tr>
a4ed814 Tyler Longren Add option to show wordpress query stats in the footer. Disabled by defa...
authored
393 <tr valign="top"><th scope="row"><label for="show_query_stats">Show Query Stats In Footer</label></th>
394 <td>
4e6cd61 Tyler Longren Remove references to old settings array.
authored
395 <input type="checkbox" id="show_query_stats" name="html5press_options[show_query_stats]" value="1" <?php checked( true, $options['show_query_stats'] ); ?> />
a4ed814 Tyler Longren Add option to show wordpress query stats in the footer. Disabled by defa...
authored
396 <label for="show_query_stats">Enabled</label>
397 </td>
398 </tr>
086b0e3 Tyler Longren Add option to display fuzzy timestamps.
authored
399 <tr valign="top"><th scope="row"><label for="fuzzy_timestamps">Fuzzy Timestamps</label></th>
400 <td>
4e6cd61 Tyler Longren Remove references to old settings array.
authored
401 <input type="checkbox" id="fuzzy_timestamps" name="html5press_options[fuzzy_timestamps]" value="1" <?php checked( true, $options['fuzzy_timestamps'] ); ?> />
086b0e3 Tyler Longren Add option to display fuzzy timestamps.
authored
402 <label for="fuzzy_timestamps">Enabled</label>
403 </td>
404 </tr>
02b259e Tyler Longren Add option to only show post excerpts on the front page.
authored
405 <tr valign="top"><th scope="row"><label for="homepage_article_summary">Article Summaries on Home Page</label></th>
406 <td>
4e6cd61 Tyler Longren Remove references to old settings array.
authored
407 <input type="checkbox" id="homepage_article_summary" name="html5press_options[homepage_article_summary]" value="1" <?php checked( true, $options['homepage_article_summary'] ); ?> />
02b259e Tyler Longren Add option to only show post excerpts on the front page.
authored
408 <label for="homepage_article_summary">Enabled</label>
409 </td>
410 </tr>
acc2e69 Tyler Longren Add slimbox2 to HTML5Press. It's disabled by default, but can be turned ...
authored
411 <tr valign="top"><th scope="row"><label for="maintenance_mode">Maintenance Mode</label></th>
61966bf Tyler Longren Add "Maintenance Mode" option to allow admins to show the maintenance mo...
authored
412 <td>
4e6cd61 Tyler Longren Remove references to old settings array.
authored
413 <input type="checkbox" id="maintenance_mode" name="html5press_options[maintenance_mode]" value="1" <?php checked( true, $options['maintenance_mode'] ); ?> />
61966bf Tyler Longren Add "Maintenance Mode" option to allow admins to show the maintenance mo...
authored
414 <label for="maintenance_mode">Enabled</label>
415 </td>
416 </tr>
a22c9c4 Tyler Longren Add option for custom logo.
authored
417 <tr valign="top"><th scope="row"><label for="custom_logo_url">Custom Logo URL</label></th>
418 <td>
4e6cd61 Tyler Longren Remove references to old settings array.
authored
419 <input type="text" id="custom_logo_url" name="html5press_options[custom_logo_url]" value="<?php echo esc_attr($options['custom_logo_url']); ?>" />
a22c9c4 Tyler Longren Add option for custom logo.
authored
420 </td>
421 </tr>
d97ab85 Tyler Longren Add option to set size of image that's linked to from featured images.
authored
422 <tr valign="top"><th scope="row"><label for="featured_image_size">Linked Featured Image Size</label></th>
423 <td>
424 <select id="featured_image_size" name="html5press_options[featured_image_size]">
425 <?php
426 foreach ( $html5press_image_sizes as $images ) :
427 $label = $images['label'];
428 $selected = '';
4e6cd61 Tyler Longren Remove references to old settings array.
authored
429 if ( $images['value'] == $options['featured_image_size'] )
d97ab85 Tyler Longren Add option to set size of image that's linked to from featured images.
authored
430 $selected = 'selected="selected"';
431 echo '<option style="padding-right: 10px;" value="' . esc_attr( $images['value'] ) . '" ' . $selected . '>' . $label . '</option>';
432 endforeach;
433 ?>
434 </select>
435 </td>
436 </tr>
f2dfcc7 Tyler Longren Add stylesheet chooser to options and include that stylesheet when loadi...
authored
437 <tr valign="top"><th scope="row"><label for="theme_color">Theme Color</label></th>
438 <td>
439 <select id="theme_color" name="html5press_options[theme_color]">
440 <?php
441 foreach ( $html5press_theme_colors as $colors ) :
442 $label = $colors['label'];
443 $selected = '';
4e6cd61 Tyler Longren Remove references to old settings array.
authored
444 if ( $colors['value'] == $options['theme_color'] )
f2dfcc7 Tyler Longren Add stylesheet chooser to options and include that stylesheet when loadi...
authored
445 $selected = 'selected="selected"';
446 echo '<option style="padding-right: 10px;" value="' . esc_attr( $colors['value'] ) . '" ' . $selected . '>' . $label . '</option>';
447 endforeach;
448 ?>
449 </select>
450 </td>
451 </tr>
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
452 <tr valign="top"><th scope="row"><label for="theme_font">Theme Font</label></th>
453 <td>
454 <select id="theme_font" name="html5press_options[theme_font]">
455 <?php
456 foreach ( $html5press_theme_fonts as $fonts ) :
457 $label = $fonts['label'];
458 $selected = '';
4e6cd61 Tyler Longren Remove references to old settings array.
authored
459 if ( $fonts['value'] == $options['theme_font'] )
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
460 $selected = 'selected="selected"';
461 echo '<option style="padding-right: 10px;" value="' . esc_attr( $fonts['value'] ) . '" ' . $selected . '>' . $label . '</option>';
462 endforeach;
463 ?>
464 </select>
465 </td>
466 </tr>
a49fa48 Tyler Longren Update label for featured category.
authored
467 <tr valign="top"><th scope="row"><label for="featured_cat">Featured Post Category</label></th>
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
468 <td>
469 <select id="featured_cat" name="html5press_options[featured_cat]">
470 <?php
471 foreach ( $html5press_categories as $category ) :
472 $label = $category['label'];
473 $selected = '';
4e6cd61 Tyler Longren Remove references to old settings array.
authored
474 if ( $category['value'] == $options['featured_cat'] )
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
475 $selected = 'selected="selected"';
476 echo '<option style="padding-right: 10px;" value="' . esc_attr( $category['value'] ) . '" ' . $selected . '>' . $label . '</option>';
477 endforeach;
478 ?>
479 </select>
480 </td>
481 </tr>
482 <tr valign="top"><th scope="row"><label for="num_featured"># Featured Posts to Show</label></th>
483 <td>
484 <select id="num_featured" name="html5press_options[num_featured]">
485 <?php
486 foreach ( $html5press_num_featured_options as $featured ) :
487 $label = $featured['label'];
488 $selected = '';
4e6cd61 Tyler Longren Remove references to old settings array.
authored
489 if ( $featured['value'] == $options['num_featured'] )
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
490 $selected = 'selected="selected"';
491 echo '<option style="padding-right: 10px;" value="' . esc_attr( $featured['value'] ) . '" ' . $selected . '>' . $label . '</option>';
492 endforeach;
493 ?>
494 </select>
495 </td>
496 </tr>
41e9e43 Tyler Longren Add a "Custom CSS" field to the options page. This may get its own page ...
authored
497 <tr valign="top"><th scope="row"><label for="custom_css">Custom CSS</label></th>
498 <td>
4e6cd61 Tyler Longren Remove references to old settings array.
authored
499 <textarea name="html5press_options[custom_css]" style="width:350px; height:200px;" cols="" rows=""><?php echo esc_attr($options['custom_css']); ?></textarea>
41e9e43 Tyler Longren Add a "Custom CSS" field to the options page. This may get its own page ...
authored
500 </td>
501 </tr>
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
502 </table>
503
504 <p class="submit"><input type="submit" class="button-primary" value="Save Options" /></p>
505
506 </form>
507
256ad86 Tyler Longren Add initial theme options page. Mostly to enable/disable the "back to to...
authored
508 </div>
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
509
256ad86 Tyler Longren Add initial theme options page. Mostly to enable/disable the "back to to...
authored
510 <?php
511 }
512
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
513 function html5press_validate_options( $input ) {
4e6cd61 Tyler Longren Remove references to old settings array.
authored
514 global $html5press_image_sizes, $html5press_categories, $html5press_num_featured_options, $html5press_theme_colors, $html5press_theme_fonts;
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
515
a22c9c4 Tyler Longren Add option for custom logo.
authored
516 $input['custom_logo_url'] = wp_filter_nohtml_kses( $input['custom_logo_url'] );
517
d97ab85 Tyler Longren Add option to set size of image that's linked to from featured images.
authored
518 // We select the previous value of the field, to restore it in case an invalid entry has been given
4e6cd61 Tyler Longren Remove references to old settings array.
authored
519 $prev = $options['featured_cat'];
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
520 // We verify if the given value exists in the categories array
521 if ( !array_key_exists( $input['featured_cat'], $html5press_categories ) )
522 $input['featured_cat'] = $prev;
523
524 // We select the previous value of the field, to restore it in case an invalid entry has been given
4e6cd61 Tyler Longren Remove references to old settings array.
authored
525 $prev = $options['num_featured'];
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
526 // We verify if the given value exists in the categories array
369cf58 Tyler Longren Fix issue #8, courtesy of adeptris (http://profiles.wordpress.org/users/...
authored
527 if ( !array_key_exists( $input['num_featured'], $html5press_num_featured_options ) )
528 $input['num_featured'] = $prev;
f2dfcc7 Tyler Longren Add stylesheet chooser to options and include that stylesheet when loadi...
authored
529
530 // We select the previous value of the field, to restore it in case an invalid entry has been given
4e6cd61 Tyler Longren Remove references to old settings array.
authored
531 $prev = $options['theme_color'];
f2dfcc7 Tyler Longren Add stylesheet chooser to options and include that stylesheet when loadi...
authored
532 if ( !array_key_exists( $input['theme_color'], $html5press_theme_colors ) )
533 $input['theme_color'] = $prev;
791ed95 Tyler Longren Add featured post slider and related theme options (ie: choose category ...
authored
534
535 // We select the previous value of the field, to restore it in case an invalid entry has been given
4e6cd61 Tyler Longren Remove references to old settings array.
authored
536 $prev = $options['theme_font'];
31fa13c Tyler Longren Added 20 fonts from the Google Font Directory. Fonts can be chosen from ...
authored
537 if ( !array_key_exists( $input['theme_font'], $html5press_theme_fonts ) )
538 $input['theme_font'] = $prev;
539
540 // We select the previous value of the field, to restore it in case an invalid entry has been given
4e6cd61 Tyler Longren Remove references to old settings array.
authored
541 $prev = $options['featured_image_size'];
d97ab85 Tyler Longren Add option to set size of image that's linked to from featured images.
authored
542 if ( !array_key_exists( $input['featured_image_size'], $html5press_image_sizes ) )
543 $input['featured_image_size'] = $prev;
544
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
545 // If the checkbox has not been checked, we void it
87a8a2d Tyler Longren Add option to disable the tagline from showing in the header.
authored
546 if ( ! isset( $input['show_tagline'] ) )
547 $input['show_tagline'] = null;
548 // We verify if the input is a boolean value
549 $input['show_tagline'] = ( $input['show_tagline'] == 1 ? 1 : 0 );
550
551 // If the checkbox has not been checked, we void it
acc2e69 Tyler Longren Add slimbox2 to HTML5Press. It's disabled by default, but can be turned ...
authored
552 if ( ! isset( $input['enable_slimbox'] ) )
553 $input['enable_slimbox'] = null;
554 // We verify if the input is a boolean value
555 $input['enable_slimbox'] = ( $input['enable_slimbox'] == 1 ? 1 : 0 );
556
557 // If the checkbox has not been checked, we void it
a4ed814 Tyler Longren Add option to show wordpress query stats in the footer. Disabled by defa...
authored
558 if ( ! isset( $input['show_query_stats'] ) )
559 $input['show_query_stats'] = null;
560 // We verify if the input is a boolean value
561 $input['show_query_stats'] = ( $input['show_query_stats'] == 1 ? 1 : 0 );
562
563 // If the checkbox has not been checked, we void it
086b0e3 Tyler Longren Add option to display fuzzy timestamps.
authored
564 if ( ! isset( $input['fuzzy_timestamps'] ) )
565 $input['fuzzy_timestamps'] = null;
566 // We verify if the input is a boolean value
567 $input['fuzzy_timestamps'] = ( $input['fuzzy_timestamps'] == 1 ? 1 : 0 );
568
02b259e Tyler Longren Add option to only show post excerpts on the front page.
authored
569 // If the checkbox has not been checked, we void it
570 if ( ! isset( $input['homepage_article_summary'] ) )
571 $input['homepage_article_summary'] = null;
572 // We verify if the input is a boolean value
573 $input['homepage_article_summary'] = ( $input['homepage_article_summary'] == 1 ? 1 : 0 );
086b0e3 Tyler Longren Add option to display fuzzy timestamps.
authored
574
575 // If the checkbox has not been checked, we void it
61966bf Tyler Longren Add "Maintenance Mode" option to allow admins to show the maintenance mo...
authored
576 if ( ! isset( $input['maintenance_mode'] ) )
577 $input['maintenance_mode'] = null;
578 // We verify if the input is a boolean value
579 $input['maintenance_mode'] = ( $input['maintenance_mode'] == 1 ? 1 : 0 );
580
581 // If the checkbox has not been checked, we void it
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
582 if ( ! isset( $input['back_to_top'] ) )
583 $input['back_to_top'] = null;
584 // We verify if the input is a boolean value
585 $input['back_to_top'] = ( $input['back_to_top'] == 1 ? 1 : 0 );
f033f6d Tyler Longren Add option for infinite scrolling!
authored
586
587 // If the checkbox has not been checked, we void it
588 if ( ! isset( $input['infinite_scroll'] ) )
589 $input['infinite_scroll'] = null;
590 // We verify if the input is a boolean value
591 $input['infinite_scroll'] = ( $input['infinite_scroll'] == 1 ? 1 : 0 );
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
592
256ad86 Tyler Longren Add initial theme options page. Mostly to enable/disable the "back to to...
authored
593 return $input;
cf4b165 Tyler Longren Better options. Now turns the "back to top" button on by default.
authored
594 }
595
596 endif; // EndIf is_admin()
de09163 Tyler Longren Add a black color scheme to choose from.
authored
597 ?>
Something went wrong with that request. Please try again.