@@ -21,13 +21,6 @@ public function render_content() {
21
21
<?php
22
22
}
23
23
}
24
-
25
- /**
26
- * Adds a favicon image uploader control that only allows .ico and .png files to be uploaded.
27
- */
28
- class Decode_Customize_Favicon_Image_Control extends WP_Customize_Image_Control {
29
- public $ extensions = array ( 'png ' , 'ico ' , 'image/x-icon ' );
30
- }
31
24
32
25
/**
33
26
* Slider Control
@@ -187,8 +180,8 @@ class Decode_Customize {
187
180
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
188
181
*/
189
182
public static function decode_customize_register ( $ wp_customize ) {
190
- $ wp_customize ->get_setting ( 'blogname ' ) ->transport = 'postMessage ' ;
191
- $ wp_customize ->get_setting ( 'blogdescription ' ) ->transport = 'postMessage ' ;
183
+ $ wp_customize ->get_setting ( 'blogname ' )->transport = 'postMessage ' ;
184
+ $ wp_customize ->get_setting ( 'blogdescription ' )->transport = 'postMessage ' ;
192
185
$ wp_customize ->get_setting ( 'header_textcolor ' )->transport = 'postMessage ' ;
193
186
$ wp_customize ->get_setting ( 'background_color ' )->transport = 'postMessage ' ;
194
187
$ wp_customize ->get_setting ( 'header_image ' )->transport = 'postMessage ' ;
@@ -207,6 +200,7 @@ public static function decode_customize_register( $wp_customize ) {
207
200
remove_theme_mod ( 'steam_user ' );
208
201
remove_theme_mod ( 'steam_group ' );
209
202
remove_theme_mod ( 'show_all_post_types ' );
203
+ remove_theme_mod ( 'favicon_image ' );
210
204
$ wp_customize ->remove_setting ( 'youtube_username ' );
211
205
$ wp_customize ->remove_setting ( 'show_site_navigation ' );
212
206
$ wp_customize ->remove_setting ( 'show_social_icons ' );
@@ -215,6 +209,7 @@ public static function decode_customize_register( $wp_customize ) {
215
209
$ wp_customize ->remove_setting ( 'steam_user ' );
216
210
$ wp_customize ->remove_setting ( 'steam_group ' );
217
211
$ wp_customize ->remove_setting ( 'show_all_post_types ' );
212
+ $ wp_customize ->remove_setting ( 'favicon_image ' );
218
213
219
214
/**
220
215
* Header Options
@@ -224,12 +219,6 @@ public static function decode_customize_register( $wp_customize ) {
224
219
'title ' => __ ( 'Header Options ' , 'decode ' ),
225
220
'priority ' => 32 ,
226
221
) );
227
-
228
-
229
- $ wp_customize ->add_setting ( 'favicon_image ' , array (
230
- 'default ' => '' ,
231
- 'sanitize_callback ' => 'decode_sanitize_string ' ,
232
- ) );
233
222
234
223
$ wp_customize ->add_setting ( 'show_site_title ' , array (
235
224
'default ' => true ,
@@ -254,16 +243,6 @@ public static function decode_customize_register( $wp_customize ) {
254
243
'transport ' => 'postMessage ' ,
255
244
'sanitize_callback ' => 'decode_sanitize_html ' ,
256
245
) );
257
-
258
-
259
- $ wp_customize ->add_control (
260
- new Decode_Customize_Favicon_Image_Control (
261
- $ wp_customize , 'favicon_image ' , array (
262
- 'label ' => __ ( 'Favicon Image (must be a PNG) ' , 'decode ' ),
263
- 'section ' => 'decode_header_options ' ,
264
- 'settings ' => 'favicon_image ' ,
265
- 'priority ' => 1 ,
266
- ) ) );
267
246
268
247
$ wp_customize ->add_control ( 'show_site_title ' , array (
269
248
'label ' => __ ( 'Show Site Title ' , 'decode ' ),
@@ -280,7 +259,7 @@ public static function decode_customize_register( $wp_customize ) {
280
259
) );
281
260
282
261
$ wp_customize ->add_control ( 'show_header_menu ' , array (
283
- 'label ' => __ ( 'Show Header Menu ' , 'decode ' ),
262
+ 'label ' => __ ( 'Show Navigation Menu ' , 'decode ' ),
284
263
'section ' => 'decode_header_options ' ,
285
264
'type ' => 'checkbox ' ,
286
265
'priority ' => 4 ,
@@ -1269,16 +1248,36 @@ public static function decode_customize_register( $wp_customize ) {
1269
1248
) );
1270
1249
1271
1250
1272
- /**
1273
- * Reading Options
1274
- */
1251
+ /**
1252
+ * Content Options
1253
+ */
1254
+ $ wp_customize ->add_panel ( 'decode_content_options_panel ' , array (
1255
+ 'priority ' => 37 ,
1256
+ 'capability ' => 'edit_theme_options ' ,
1257
+ 'theme_supports ' => '' ,
1258
+ 'title ' => esc_html__ ( 'Content Options ' , 'decode ' )
1259
+ ) );
1275
1260
1276
- $ wp_customize ->add_section ( 'decode_content_options ' , array (
1277
- 'title ' => __ ( 'Content Options ' , 'decode ' ),
1278
- 'priority ' => 37 ,
1279
- 'description ' => sprintf ( _x ( 'These options change the display of %s \'s content ' , '(blog name) \'s content. ' ,'decode ' ), get_bloginfo ( 'name ' , 'display ' ) ),
1280
- ) );
1281
-
1261
+ // General
1262
+ $ wp_customize ->add_section ( 'decode_content_options_general ' , array (
1263
+ 'title ' => __ ( 'General ' , 'decode ' ),
1264
+ 'priority ' => 1 ,
1265
+ 'panel ' => 'decode_content_options_panel '
1266
+ ) );
1267
+
1268
+ // Content
1269
+ $ wp_customize ->add_section ( 'decode_content_options_content ' , array (
1270
+ 'title ' => __ ( 'Content ' , 'decode ' ),
1271
+ 'priority ' => 2 ,
1272
+ 'panel ' => 'decode_content_options_panel '
1273
+ ) );
1274
+
1275
+ // Content Single
1276
+ $ wp_customize ->add_section ( 'decode_content_options_content_single ' , array (
1277
+ 'title ' => __ ( 'Content Single ' , 'decode ' ),
1278
+ 'priority ' => 3 ,
1279
+ 'panel ' => 'decode_content_options_panel '
1280
+ ) );
1282
1281
1283
1282
$ wp_customize ->add_setting ( 'latin_extended_font ' , array (
1284
1283
'default ' => false ,
@@ -1363,8 +1362,9 @@ public static function decode_customize_register( $wp_customize ) {
1363
1362
) );
1364
1363
1365
1364
$ wp_customize ->add_setting ( 'content_width ' , array (
1366
- 'default ' => 792 ,
1367
- 'sanitize_callback ' => 'absint '
1365
+ 'default ' => 41.619 ,
1366
+ 'sanitize_callback ' => 'absint ' ,
1367
+ 'transport ' => 'postMessage '
1368
1368
) );
1369
1369
1370
1370
$ wp_customize ->add_setting ( 'site_colophon ' , array (
@@ -1376,141 +1376,142 @@ public static function decode_customize_register( $wp_customize ) {
1376
1376
1377
1377
$ wp_customize ->add_control ( 'latin_extended_font ' , array (
1378
1378
'label ' => __ ( 'Load Latin Extended character set. This will increase page load times. ' , 'decode ' ),
1379
- 'section ' => 'decode_content_options ' ,
1379
+ 'section ' => 'decode_content_options_general ' ,
1380
1380
'type ' => 'checkbox ' ,
1381
1381
'priority ' => 1 ,
1382
1382
) );
1383
1383
1384
1384
$ wp_customize ->add_control ( 'use_excerpts ' , array (
1385
1385
'label ' => __ ( 'Use entry excerpts instead of full text on site home. Excludes sticky posts. ' , 'decode ' ),
1386
- 'section ' => 'decode_content_options ' ,
1386
+ 'section ' => 'decode_content_options_content ' ,
1387
1387
'type ' => 'checkbox ' ,
1388
- 'priority ' => 2 ,
1388
+ 'priority ' => 1 ,
1389
1389
) );
1390
1390
1391
1391
$ wp_customize ->add_control ( 'use_excerpts_on_archives ' , array (
1392
1392
'label ' => __ ( 'Use entry excerpts on archive, category, and author pages. ' , 'decode ' ),
1393
- 'section ' => 'decode_content_options ' ,
1393
+ 'section ' => 'decode_content_options_content ' ,
1394
1394
'type ' => 'checkbox ' ,
1395
- 'priority ' => 3 ,
1395
+ 'priority ' => 2 ,
1396
1396
) );
1397
1397
1398
1398
$ wp_customize ->add_control ( 'show_featured_images_on_excerpts ' , array (
1399
1399
'label ' => __ ( 'Display posts \' featured images when excerpts are shown. ' , 'decode ' ),
1400
- 'section ' => 'decode_content_options ' ,
1400
+ 'section ' => 'decode_content_options_content ' ,
1401
1401
'type ' => 'checkbox ' ,
1402
- 'priority ' => 4 ,
1402
+ 'priority ' => 3 ,
1403
1403
) );
1404
1404
1405
1405
$ wp_customize ->add_control ( 'show_featured_images_on_singles ' , array (
1406
1406
'label ' => __ ( 'Display a post \'s featured image on its individual page. ' , 'decode ' ),
1407
- 'section ' => 'decode_content_options ' ,
1407
+ 'section ' => 'decode_content_options_content_single ' ,
1408
1408
'type ' => 'checkbox ' ,
1409
- 'priority ' => 5 ,
1409
+ 'priority ' => 1 ,
1410
1410
) );
1411
1411
1412
1412
$ wp_customize ->add_control ( 'show_tags ' , array (
1413
1413
'label ' => __ ( 'Show tags on front page (tags will be shown on post \'s individual page) ' , 'decode ' ),
1414
- 'section ' => 'decode_content_options ' ,
1414
+ 'section ' => 'decode_content_options_content ' ,
1415
1415
'type ' => 'checkbox ' ,
1416
- 'priority ' => 6 ,
1416
+ 'priority ' => 4 ,
1417
1417
) );
1418
1418
1419
1419
$ wp_customize ->add_control ( 'show_categories ' , array (
1420
1420
'label ' => __ ( 'Show categories on front page (categories will be shown on post \'s individual page) ' , 'decode ' ),
1421
- 'section ' => 'decode_content_options ' ,
1421
+ 'section ' => 'decode_content_options_content ' ,
1422
1422
'type ' => 'checkbox ' ,
1423
- 'priority ' => 7 ,
1423
+ 'priority ' => 5 ,
1424
1424
) );
1425
1425
1426
1426
$ wp_customize ->add_control ( 'show_author_section ' , array (
1427
1427
'label ' => __ ( 'Show author \'s name, profile image, and bio after posts ' , 'decode ' ),
1428
- 'section ' => 'decode_content_options ' ,
1428
+ 'section ' => 'decode_content_options_content_single ' ,
1429
1429
'type ' => 'checkbox ' ,
1430
- 'priority ' => 8 ,
1430
+ 'priority ' => 2 ,
1431
1431
) );
1432
1432
1433
1433
$ wp_customize ->add_control ( 'show_leave_a_comment_link ' , array (
1434
1434
'label ' => __ ( 'Show "Leave a comment" link after posts. ' , 'decode ' ),
1435
- 'section ' => 'decode_content_options ' ,
1435
+ 'section ' => 'decode_content_options_content_single ' ,
1436
1436
'type ' => 'checkbox ' ,
1437
- 'priority ' => 9 ,
1437
+ 'priority ' => 3 ,
1438
1438
) );
1439
1439
1440
1440
$ wp_customize ->add_control ( 'entry_date_position ' , array (
1441
1441
'label ' => __ ( 'Entry Date Position ' , 'decode ' ),
1442
- 'section ' => 'decode_content_options ' ,
1442
+ 'section ' => 'decode_content_options_general ' ,
1443
1443
'type ' => 'radio ' ,
1444
1444
'choices ' => array (
1445
1445
'above ' => __ ( 'Above Header ' , 'decode ' ),
1446
1446
'below ' => __ ( 'Below Header ' , 'decode ' ),
1447
1447
),
1448
- 'priority ' => 10 ,
1448
+ 'priority ' => 2 ,
1449
1449
) );
1450
1450
1451
1451
$ wp_customize ->add_control ( 'show_entry_date_on_excerpts ' , array (
1452
1452
'label ' => __ ( 'Show entry date for post excepts on the main page ' , 'decode ' ),
1453
- 'section ' => 'decode_content_options ' ,
1453
+ 'section ' => 'decode_content_options_content ' ,
1454
1454
'type ' => 'checkbox ' ,
1455
- 'priority ' => 11 ,
1455
+ 'priority ' => 6 ,
1456
1456
) );
1457
1457
1458
1458
$ wp_customize ->add_control ( 'show_allowed_tags ' , array (
1459
1459
'label ' => __ ( 'Show allowed HTML tags on comment form ' , 'decode ' ),
1460
- 'section ' => 'decode_content_options ' ,
1460
+ 'section ' => 'decode_content_options_content_single ' ,
1461
1461
'type ' => 'checkbox ' ,
1462
- 'priority ' => 12 ,
1462
+ 'priority ' => 4 ,
1463
1463
) );
1464
1464
1465
1465
$ wp_customize ->add_control ( 'show_page_headers ' , array (
1466
1466
'label ' => __ ( 'Show Page Headers ' , 'decode ' ),
1467
- 'section ' => 'decode_content_options ' ,
1467
+ 'section ' => 'decode_content_options_general ' ,
1468
1468
'type ' => 'checkbox ' ,
1469
- 'priority ' => 13 ,
1469
+ 'priority ' => 3 ,
1470
1470
) );
1471
1471
1472
1472
$ wp_customize ->add_control ( 'link_post_title_arrow ' , array (
1473
1473
'label ' => __ ( 'Add an arrow before the title of a link post ' , 'decode ' ),
1474
- 'section ' => 'decode_content_options ' ,
1474
+ 'section ' => 'decode_content_options_general ' ,
1475
1475
'type ' => 'checkbox ' ,
1476
- 'priority ' => 14 ,
1476
+ 'priority ' => 4 ,
1477
1477
) );
1478
1478
1479
1479
$ wp_customize ->add_control ( 'show_theme_info ' , array (
1480
1480
'label ' => __ ( 'Show Theme Info (display a line of text about the theme and its creator at the bottom of pages) ' , 'decode ' ),
1481
- 'section ' => 'decode_content_options ' ,
1481
+ 'section ' => 'decode_content_options_general ' ,
1482
1482
'type ' => 'checkbox ' ,
1483
- 'priority ' => 15 ,
1483
+ 'priority ' => 5 ,
1484
1484
) );
1485
1485
1486
1486
$ wp_customize ->add_control ( 'center_content_mobile ' , array (
1487
1487
'label ' => __ ( 'Center the content on mobile. ' , 'decode ' ),
1488
- 'section ' => 'decode_content_options ' ,
1488
+ 'section ' => 'decode_content_options_general ' ,
1489
1489
'type ' => 'checkbox ' ,
1490
- 'priority ' => 16 ,
1490
+ 'priority ' => 6 ,
1491
1491
) );
1492
1492
1493
1493
$ wp_customize ->add_control (
1494
1494
new Decode_Customize_Slider_Control (
1495
1495
$ wp_customize , 'content_width ' , array (
1496
1496
'label ' => esc_html__ ( 'Content Width ' , 'decode ' ),
1497
+ 'description ' => esc_html__ ( 'Select the content width in percentage. ' , 'decode ' ),
1497
1498
'choices ' => array (
1498
- 'min ' => 640 ,
1499
- 'max ' => 792 ,
1500
- 'step ' => 1
1499
+ 'min ' => 41.619 ,
1500
+ 'max ' => 80 ,
1501
+ 'step ' => 0.001
1501
1502
),
1502
- 'section ' => 'decode_content_options ' ,
1503
- 'priority ' => 17 ,
1503
+ 'section ' => 'decode_content_options_general ' ,
1504
+ 'priority ' => 7 ,
1504
1505
) ) );
1505
1506
1506
1507
$ wp_customize ->add_control (
1507
1508
new Decode_Customize_Textarea_Control (
1508
1509
$ wp_customize , 'site_colophon ' , array (
1509
1510
'label ' => __ ( 'Text (colophon, copyright, credits, etc.) for the footer of the site ' , 'decode ' ),
1510
- 'section ' => 'decode_content_options ' ,
1511
+ 'section ' => 'decode_content_options_general ' ,
1511
1512
'settings ' => 'site_colophon ' ,
1512
1513
'type ' => 'textarea ' ,
1513
- 'priority ' => 18 ,
1514
+ 'priority ' => 8 ,
1514
1515
) ) );
1515
1516
1516
1517
@@ -1521,7 +1522,6 @@ public static function decode_customize_register( $wp_customize ) {
1521
1522
1522
1523
$ wp_customize ->add_section ( 'decode_other_options ' , array (
1523
1524
'title ' => __ ( 'Other Options ' , 'decode ' ),
1524
- 'description ' => __ ( 'Custom CSS is longer recommended. This feature may be removed in a future update. To continue using your tweaks, copy and paste your CSS into a custom CSS plugin such as <a href="http://jetpack.me/install/">Jetpack</a>. Get help <a href="http://jetpack.me/support/custom-css/">here</a>. ' , 'decode ' ),
1525
1525
'priority ' => 38 ,
1526
1526
) );
1527
1527
@@ -1645,7 +1645,8 @@ public static function decode_output_color_css() {
1645
1645
?>
1646
1646
<!-- Decode Custom Colors CSS -->
1647
1647
<style type="text/css">
1648
- <?php self ::generate_css (
1648
+ <?php
1649
+ self ::generate_css (
1649
1650
'body, .sidebar, .sidebar-top, .menu ul ul, .header-style-ghost .site ' ,
1650
1651
'background-color ' ,
1651
1652
'background_color ' ,
@@ -1763,8 +1764,23 @@ public static function decode_output_color_css() {
1763
1764
'border-color ' ,
1764
1765
'accent_color '
1765
1766
);
1766
-
1767
1767
?>
1768
+
1769
+ @media (min-width: 68.5em) {
1770
+ .site-main {
1771
+ max-width: none;
1772
+ }
1773
+
1774
+ <?php
1775
+ self ::generate_css (
1776
+ '.site-main ' ,
1777
+ 'width ' ,
1778
+ 'content_width ' ,
1779
+ '' ,
1780
+ '% '
1781
+ );
1782
+ ?>
1783
+ }
1768
1784
</style>
1769
1785
<?php
1770
1786
}
0 commit comments