Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update to 1.1.0

allows remove_theme_support in child themes, simplified columns
function, changed template layout options
  • Loading branch information...
commit fd642258da3b92b40c681834dedf5a8105d75ece 1 parent edde345
Anthony Wilhelm authored
Showing with 1,502 additions and 1,355 deletions.
  1. +0 −1  .gitignore
  2. +29 −2 README.md
  3. +85 −5 functions.php
  4. +24 −11 library/css/reactor.css
  5. +15 −11 library/inc/{extensions → }/content/content-footer.php
  6. +19 −17 library/inc/{extensions → }/content/content-header.php
  7. +4 −4 library/inc/{extensions → }/content/content-pages.php
  8. +2 −2 library/inc/{extensions → }/content/content-posts.php
  9. +285 −256 library/inc/customizer/{customizer-init.php → customize.php}
  10. +141 −168 library/inc/extensions/menus.php
  11. +218 −203 library/inc/extensions/post-types.php
  12. +0 −102 library/inc/extensions/scripts-styles.php
  13. +52 −0 library/inc/extensions/scripts.php
  14. +74 −58 library/inc/extensions/sidebars.php
  15. +63 −0 library/inc/extensions/styles.php
  16. +0 −49 library/inc/extensions/theme-support.php
  17. +119 −220 library/inc/functions/columns.php
  18. +36 −22 library/inc/functions/get-options.php
  19. +83 −35 library/inc/functions/helpers.php
  20. +35 −10 library/inc/functions/page-links.php
  21. +8 −4 library/inc/metaboxes/{meta-init.php → custom-meta.php}
  22. +5 −1 library/inc/metaboxes/js/scripts.js
  23. +33 −6 library/inc/metaboxes/meta-fields.php
  24. +1 −0  library/inc/shortcodes/reactor-shortcodes.php
  25. +1 −1  library/js/reactor.js
  26. +0 −58 library/reactor-init.php
  27. +76 −0 library/reactor.php
  28. +1 −1  loops/loop-page.php
  29. +0 −36 page-templates/full-width.php
  30. +0 −39 page-templates/left-sidebar.php
  31. +3 −1 page-templates/portfolio.php
  32. +2 −2 page-templates/side-menu.php
  33. +52 −0 readme.txt
  34. +2 −2 searchform.php
  35. +10 −9 sidebar-frontpage.php
  36. +10 −9 sidebar.php
  37. +1 −1  style.css
  38. +5 −3 taxonomy-portfolio-category.php
  39. +8 −6 taxonomy-portfolio-tag.php
View
1  .gitignore
@@ -1 +0,0 @@
-.DS_Store
View
31 README.md
@@ -1,6 +1,33 @@
Reactor
=======
-A powerful WordPress Framework generated using ZURB's Foundation
+#### A powerful WordPress Framework generated using ZURB's Foundation
+Reactor is a responsive parent theme for WordPress. That means that it can be used as is or made to look and function however you like using a child theme. Reactor comes packed with a bunch of great features such as shortcodes, customizer settings, and page templates. It also includes all the fantastic scripts and styles found in Foundation 4 by ZURB.
-Demo: http://demo.awtheme.com/reactor/
+
+Demo
+----
+
+http://demo.awtheme.com/reactor/
+
+
+Documentation
+-------------
+
+http://awtheme.com/docs/
+
+
+Author
+------
+
+Anthony Wilhelm (@awshout)<br/>
+http://anthonywilhelm.com
+
+
+License
+-------
+
+GPLv2 (or later, Same as WordPress) - http://www.gnu.org/licenses/gpl-2.0.html<br/>
+Foundation by ZURB is MIT - http://opensource.org/licenses/MIT<br/>
+
+Basically this means Reactor is free to use! A link back is always appreciated.
View
90 functions.php
@@ -4,13 +4,93 @@
*
* @package Reactor
* @author Anthony Wilhelm (@awshout / anthonywilhelm.com)
- * @version 1.0.0
- * @since 1.0.0
+ * @version 2.0.0
+ * @since 2.0.0
* @copyright Copyright (c) 2013, Anthony Wilhelm
* @license GNU General Public License v2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
*/
-// if you remove this, the sky will fall!
-require( 'library/reactor-init.php' );
+require locate_template('library/reactor.php');
+new Reactor();
-/* ------------------------------------------------------- */
+add_action('after_setup_theme', 'reactor_theme_setup', 10);
+
+function reactor_theme_setup() {
+
+ /**
+ * Reactor features
+ */
+ add_theme_support(
+ 'reactor-menus',
+ array('top-bar-l', 'top-bar-r', 'main-menu', 'side-menu', 'footer-links')
+ );
+
+ add_theme_support(
+ 'reactor-sidebars',
+ array('primary', 'secondary', 'front-primary', 'front-secondary', 'footer')
+ );
+
+ add_theme_support(
+ 'reactor-layouts',
+ array('1c', '2c-l', '2c-r', '3c-l', '3c-r', '3c-c')
+ );
+
+ add_theme_support(
+ 'reactor-post-types',
+ array('slides', 'portfolio')
+ );
+
+ add_theme_support(
+ 'reactor-page-templates',
+ array('front-page', 'news-page', 'portfolio', 'contact')
+ );
+
+ add_theme_support('reactor-backgrounds');
+
+ add_theme_support('reactor-fonts');
+
+ add_theme_support('reactor-breadcrumbs');
+
+ add_theme_support('reactor-page-links');
+
+ add_theme_support('reactor-post-meta');
+
+ add_theme_support('reactor-shortcodes');
+
+ add_theme_support('reactor-custom-login');
+
+ add_theme_support('reactor-taxonomy-subnav');
+
+ add_theme_support('reactor-tumblog-icons');
+
+ add_theme_support('reactor-translation');
+
+ /**
+ * WordPress features
+ */
+ add_theme_support('menus');
+
+ // different post formats for tumblog style posting
+ add_theme_support(
+ 'post-formats',
+ array('aside', 'gallery','link', 'image', 'quote', 'status', 'video', 'audio', 'chat')
+ );
+
+ add_theme_support('post-thumbnails');
+ // thumbnail sizes - you can add more
+ add_image_size('thumb-300', 300, 250, true);
+ add_image_size('thumb-200', 200, 150, true);
+
+ // these are not needed
+ // add_theme_support('custom-background');
+ // add_theme_support('custom-header');
+
+ // RSS feed links to header.php for posts and comments.
+ add_theme_support('automatic-feed-links');
+
+ // editor stylesheet for TinyMCE
+ add_editor_style('/library/css/editor.css');
+
+ if ( !isset( $content_width ) ) $content_width = 1000;
+
+}
View
35 library/css/reactor.css
@@ -73,8 +73,10 @@ ul[class*=block-grid] a {
line-height:45px;
padding:0 15px;
}
-.top-bar-section .has-dropdown .dropdown li.has-dropdown > a:after {
- top:7px;
+@media only screen and (min-width: 48em) {
+ .top-bar-section .has-dropdown .dropdown li.has-dropdown > a:after {
+ top:7px;
+ }
}
/* Header ---------------------- */
.inner-header {
@@ -321,7 +323,8 @@ ul.pagination {
display:block
}
/* Horizontal Nav ---------------------- */
-.section-container.horizontal-nav .section .title.has-dropdown > a:after, #mobile-menu .section-container.accordion .section .title.has-dropdown > a:after {
+#menu .section-container.horizontal-nav .section .title.has-dropdown > a:after,
+#mobile-menu .section-container.accordion .section .title.has-dropdown > a:after {
content: "";
display: block;
width: 0;
@@ -333,17 +336,27 @@ ul.pagination {
right:1em;
top:1.688em
}
-.section-container.horizontal-nav .side-nav li:hover a,
+#menu .section-container .section .content,
+#mobile-menu .section-container .section .content {
+ padding: 0.9375em 0;
+}
+#menu .section-container.horizontal-nav .side-nav li,
+#mobile-menu .section-container.accordion .side-nav li {
+ margin:0;
+}
+#menu .section-container.horizontal-nav .side-nav li a,
+#mobile-menu .section-container.accordion .side-nav li a {
+ padding: 0.25em 0.9375em;
+}
+#menu .section-container.horizontal-nav .side-nav li:hover a,
#mobile-menu .section-container.accordion .side-nav li:hover a {
background:#efefef
}
-.section-container.horizontal-nav section .title.active a,
-.section-container.horizontal-nav .section .title.active a,
-.section-container.horizontal-nav.auto section .title.active a,
-.section-container.horizontal-nav.auto .section .title.active a {
+#menu .section-container.horizontal-nav .section .title.active a,
+#menu .section-container.horizontal-nav.auto .section .title.active a {
background: #d5d5d5;
}
-.section-container.horizontal-nav .section:hover .content {
+#menu .section-container.horizontal-nav .section:hover .content {
border: 1px solid #ccc;
display: block;
min-width: 12.5em;
@@ -351,10 +364,10 @@ ul.pagination {
z-index: 999;
}
@media only screen and (min-width: 48em) {
- .section-container.horizontal-nav .section .title.has-dropdown > a:after {
+ #menu .section-container.horizontal-nav .section .title.has-dropdown > a:after {
top:50%
}
- .section-container.horizontal-nav .section .title.has-dropdown > a {
+ #menu .section-container.horizontal-nav .section .title.has-dropdown > a {
padding-right:2.813em
}
}
View
26 library/inc/extensions/content/content-footer.php → library/inc/content/content-footer.php
@@ -16,18 +16,20 @@
*
* @since 1.0.0
*/
-function reactor_do_breadcrumbs() {
- if ( reactor_option('breadcrumbs', 1) ) { ?>
- <div id="breadcrumbs">
- <div class="row">
- <div class="<?php reactor_columns( 12 ); ?>">
- <?php reactor_breadcrumbs(); ?>
- </div><!-- .columns -->
- </div><!-- .row -->
- </div><!-- #breadcrumbs -->
-<?php }
+if ( current_theme_supports('reactor-breadcrumbs') ) {
+ function reactor_do_breadcrumbs() {
+ if ( reactor_option('breadcrumbs', 1) ) { ?>
+ <div id="breadcrumbs">
+ <div class="row">
+ <div class="<?php reactor_columns( 12 ); ?>">
+ <?php reactor_breadcrumbs(); ?>
+ </div><!-- .columns -->
+ </div><!-- .row -->
+ </div><!-- #breadcrumbs -->
+ <?php }
+ }
+ add_action('reactor_footer_before', 'reactor_do_breadcrumbs', 1);
}
-add_action('reactor_footer_before', 'reactor_do_breadcrumbs', 1);
/**
* Footer widgets
@@ -58,9 +60,11 @@ function reactor_do_footer_content() { ?>
<div class="row">
<div class="<?php reactor_columns( 6 ); ?>">
+ <?php if ( function_exists('reactor_footer_links') ) : ?>
<nav class="footer-links" role="navigation">
<?php reactor_footer_links(); ?>
</nav><!-- #footer-links -->
+ <?php endif; ?>
</div><!--.columns -->
<div class="<?php reactor_columns( 6 ); ?>">
View
36 library/inc/extensions/content/content-header.php → library/inc/content/content-header.php
@@ -43,17 +43,18 @@ function reactor_do_reactor_head() { ?>
* @since 1.0.0
*/
function reactor_do_top_bar() {
- $topbar_args = array(
- 'title' => reactor_option('topbar_title', get_bloginfo('name')),
- 'title_url' => reactor_option('topbar_title_url', home_url()),
- 'fixed' => reactor_option('topbar_fixed', 0),
- 'contained' => reactor_option('topbar_contain', 1),
- );
- reactor_top_bar( $topbar_args );
+ if ( has_nav_menu('top-bar-l') || has_nav_menu('top-bar-r') ) {
+ $topbar_args = array(
+ 'title' => reactor_option('topbar_title', get_bloginfo('name')),
+ 'title_url' => reactor_option('topbar_title_url', home_url()),
+ 'fixed' => reactor_option('topbar_fixed', 0),
+ 'contained' => reactor_option('topbar_contain', 1),
+ );
+ reactor_top_bar( $topbar_args );
+ }
}
add_action('reactor_header_before', 'reactor_do_top_bar', 1);
-
/**
* Site title, tagline, logo, and nav bar
* in header.php
@@ -98,8 +99,8 @@ function reactor_do_nav_bar() {
</div>
</nav>
</div><!-- .main-nav -->
- <?php } // end if main-menu
-
+
+ <?php
if ( reactor_option('mobile_menu', 1) ) { ?>
<div id="mobile-menu-button" class="show-for-small">
<button class="secondary button" id="mobileMenuButton" href="#mobile-menu">
@@ -108,7 +109,8 @@ function reactor_do_nav_bar() {
<div class="mobile-menu-icon"></div>
</button>
</div><!-- #mobile-menu-button -->
-<?php }
+ <?php }
+ }
}
add_action('reactor_header_inside', 'reactor_do_nav_bar', 2);
@@ -119,12 +121,12 @@ function reactor_do_nav_bar() {
* @since 1.0.0
*/
function reactor_do_mobile_nav() {
- if ( reactor_option('mobile_menu', 1) ) { ?>
- <nav id="mobile-menu" class="show-for-small" role="navigation">
- <div class="section-container accordion" data-section="accordion">
- <?php reactor_main_menu(); ?>
- </div>
- </nav>
+ if ( reactor_option('mobile_menu', 1) && has_nav_menu('main-menu') ) { ?>
+ <nav id="mobile-menu" class="show-for-small" role="navigation">
+ <div class="section-container accordion" data-section="accordion">
+ <?php reactor_main_menu(); ?>
+ </div>
+ </nav>
<?php }
}
add_action('reactor_header_after', 'reactor_do_mobile_nav', 1);
View
8 library/inc/extensions/content/content-pages.php → library/inc/content/content-pages.php
@@ -58,21 +58,21 @@ function reactor_do_page_edit() {
function reactor_do_page_links() {
$pagination_type = reactor_option('page_links', 'numbered');
- if ( is_page_template('page-templates/front-page.php') ) {
+ if ( is_page_template('page-templates/front-page.php') && current_theme_supports('reactor-page-links') ) {
$show_page_links = reactor_option('frontpage_page_links', 0);
if ( $show_page_links ) {
reactor_page_links( array('query' => 'frontpage_query', 'type' => $pagination_type) );
}
}
- elseif ( is_page_template('page-templates/news-page.php') ) {
+ elseif ( is_page_template('page-templates/news-page.php') && current_theme_supports('reactor-page-links') ) {
reactor_page_links( array('query' => 'newspage_query', 'type' => $pagination_type) );
}
- elseif ( is_page_template('page-templates/portfolio.php') ) {
+ elseif ( is_page_template('page-templates/portfolio.php') && current_theme_supports('reactor-page-links') ) {
$filter_type = reactor_option('portfolio_filter_type', 'jquery');
//if ( 'jquery' != $filter_type ) {
reactor_page_links( array('query' => 'portfolio_query', 'type' => $pagination_type) );
//}
- } else {
+ } elseif ( current_theme_supports('reactor-page-links') ) {
reactor_page_links( array('type' => $pagination_type) );
}
}
View
4 library/inc/extensions/content/content-posts.php → library/inc/content/content-posts.php
@@ -18,7 +18,7 @@
* @since 1.0.0
*/
function reactor_do_reactor_tublog_icons() {
- if ( reactor_option('tumblog_icons', false) && is_home() ) {
+ if ( reactor_option('tumblog_icons', false) && is_home() && current_theme_supports('reactor-tumblog-icons') ) {
$output = reactor_tumblog_icon();
echo $output;
}
@@ -129,7 +129,7 @@ function reactor_do_post_footer_meta() {
$post_meta = reactor_option('post_meta', 1);
}
- if ( $post_meta ) {
+ if ( $post_meta && current_theme_supports('reactor-post-meta') ) {
reactor_post_meta();
}
}
View
541 library/inc/customizer/customizer-init.php → library/inc/customizer/customize.php
@@ -37,6 +37,12 @@ function reactor_customizer_css() {
if ( reactor_option('bg_attachment') && reactor_option('bg_attachment') != 'scroll') {
$body_css .= 'background-attachment: ' . reactor_option('bg_attachment') . ';';
}
+ if ( 1 == reactor_option('bg_full_window', 0) ) {
+ $body_css .= '-webkit-background-size: cover';
+ $body_css .= '-moz-background-size: cover';
+ $body_css .= '-o-background-size: cover';
+ $body_css .= 'background-size: cover';
+ }
if ( reactor_option('text_color') ) {
$body_css .= 'color: ' . reactor_option('text_color') . ';';
}
@@ -145,7 +151,7 @@ function reactor_typography_google_fonts(){
}
}
}
-add_action( 'wp_enqueue_scripts', 'reactor_typography_google_fonts' );
+add_action('wp_enqueue_scripts', 'reactor_typography_google_fonts');
/**
* Enqueues the Google $font that is passed
@@ -375,17 +381,26 @@ public function render_content() {
) );
// Navigation
+ $menus = get_theme_support('reactor-menus');
+
+ if ( !is_array( $menus[0] ) ) {
+ $menus[0] = array();
+ }
+
$wp_customize->add_section('reactor_customizer_nav', array(
'title' => __('Navigation', 'reactor'),
'priority' => 10,
'description' => '',
+ 'theme_supports' => 'reactor-menus',
) );
-
+
+ if ( in_array('top-bar-l', $menus[0] ) || in_array('top-bar-r', $menus[0] ) ) {
$wp_customize->add_setting('reactor_options[topbar_title]', array(
- 'default' => get_bloginfo('name'),
- 'type' => 'option',
- 'capability' => 'manage_options',
- 'transport' => 'postMessage',
+ 'default' => get_bloginfo('name'),
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-menus',
) );
$wp_customize->add_control('reactor_options[topbar_title]', array(
'label' => __('Top Bar Title', 'reactor'),
@@ -395,9 +410,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[topbar_title_url]', array(
- 'default' => home_url(),
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => home_url(),
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-menus',
) );
$wp_customize->add_control('reactor_options[topbar_title_url]', array(
'label' => __('Top Bar Title Link', 'reactor'),
@@ -407,10 +423,11 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[topbar_fixed]', array(
- 'default' => 0,
- 'type' => 'option',
- 'capability' => 'manage_options',
- 'transport' => 'postMessage',
+ 'default' => 0,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-menus',
) );
$wp_customize->add_control('reactor_options[topbar_fixed]', array(
'label' => __('Fixed Top Bar', 'reactor'),
@@ -420,10 +437,11 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[topbar_contain]', array(
- 'default' => 1,
- 'type' => 'option',
- 'capability' => 'manage_options',
- 'transport' => 'postMessage',
+ 'default' => 1,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-menus',
) );
$wp_customize->add_control('reactor_options[topbar_contain]', array(
'label' => __('Contain Top Bar Width', 'reactor'),
@@ -431,11 +449,14 @@ public function render_content() {
'type' => 'checkbox',
'priority' => 4,
) );
-
+ }
+
+ if ( in_array('side-menu', $menus[0] ) ) {
$wp_customize->add_setting('reactor_options[side_nav_type]', array(
- 'default' => 'accordion',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 'accordion',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-menus',
) );
$wp_customize->add_control('reactor_options[side_nav_type]', array(
'label' => __('Side Menu Type', 'reactor'),
@@ -447,11 +468,14 @@ public function render_content() {
),
'priority' => 5
) );
-
+ }
+
+ if ( in_array('main-menu', $menus[0] ) ) {
$wp_customize->add_setting('reactor_options[mobile_menu]', array(
- 'default' => 1,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 1,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-menus',
) );
$wp_customize->add_control('reactor_options[mobile_menu]', array(
'label' => __('Off Canvas Main Menu', 'reactor'),
@@ -459,37 +483,46 @@ public function render_content() {
'type' => 'checkbox',
'priority' => 6
) );
-
- // Posts & Pages
+ }
+
+ // Posts & Pages
+ $layouts = get_theme_support('reactor-layouts');
+ $theme_layouts = array();
+
+ if ( !is_array( $layouts[0] ) ) {
+ $layouts[0] = array();
+ }
+
+ if ( in_array( '1c', $layouts[0] ) ) { $theme_layouts['1c'] = __('One Column', 'reactor'); }
+ if ( in_array( '2c-l', $layouts[0] ) ) { $theme_layouts['2c-l'] = __('Two Columns, Left', 'reactor'); }
+ if ( in_array( '2c-r', $layouts[0] ) ) { $theme_layouts['2c-r'] = __('Two Columns, Right', 'reactor'); }
+ if ( in_array( '3c-l', $layouts[0] ) ) { $theme_layouts['3c-l'] = __('Three Columns, Left', 'reactor'); }
+ if ( in_array( '3c-r', $layouts[0] ) ) { $theme_layouts['3c-r'] = __('Three Columns, Right', 'reactor'); }
+ if ( in_array( '3c-c', $layouts[0] ) ) { $theme_layouts['3c-c'] = __('Three Columns, Center', 'reactor'); }
+
$wp_customize->add_section('reactor_customizer_posts', array(
'title' => __('Posts & Pages', 'reactor'),
'priority' => 20,
) );
$wp_customize->add_setting('reactor_options[page_layout]', array(
- 'default' => '1side-cl',
+ 'default' => '2c-l',
'type' => 'option',
'capability' => 'manage_options',
) );
$wp_customize->add_control('reactor_options[page_layout]', array(
- 'label' => __('Layout', 'reactor'),
+ 'label' => __('Default Layout', 'reactor'),
'section' => 'reactor_customizer_posts',
'type' => 'select',
- 'choices' => array(
- '0side-cm' => __('No Sidebars', 'reactor'),
- '1side-cl' => __('1 Sidebar - Content Left', 'reactor'),
- '1side-cr' => __('1 Sidebar - Content Right', 'reactor'),
- '2side-cl' => __('2 Sidebars - Content Left', 'reactor'),
- '2side-cr' => __('2 Sidebars - Content Right', 'reactor'),
- '2side-cm' => __('2 Sidebars - Content Middle', 'reactor'),
- ),
+ 'choices' => $theme_layouts,
'priority' => 4,
) );
$wp_customize->add_setting('reactor_options[page_links]', array(
- 'default' => 'numbered',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 'numbered',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-links',
) );
$wp_customize->add_control('reactor_options[page_links]', array(
'label' => __('Page Link Type', 'reactor'),
@@ -499,7 +532,7 @@ public function render_content() {
'numbered' => __('Numbered', 'reactor'),
'prev_next' => __('Prev / Next', 'reactor'),
),
- 'priority' => 5,
+ 'priority' => 5,
) );
$wp_customize->add_setting('reactor_options[post_readmore]', array(
@@ -516,9 +549,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[post_meta]', array(
- 'default' => 1,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 1,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-post-meta',
) );
$wp_customize->add_control('reactor_options[post_meta]', array(
'label' => __('Show Post Meta', 'reactor'),
@@ -540,9 +574,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[tumblog_icons]', array(
- 'default' => 0,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 0,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-tumblog-icons',
) );
$wp_customize->add_control('reactor_options[tumblog_icons]', array(
'label' => __('Show Tumblog Icons', 'reactor'),
@@ -552,9 +587,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[breadcrumbs]', array(
- 'default' => 1,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 1,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-breadcrumbs',
) );
$wp_customize->add_control('reactor_options[breadcrumbs]', array(
'label' => __('Show Breadcrumbs', 'reactor'),
@@ -565,15 +601,17 @@ public function render_content() {
// Backgrounds
$wp_customize->add_section('reactor_customizer_background', array(
- 'title' => __('Background', 'reactor'),
- 'priority' => 25,
+ 'title' => __('Background', 'reactor'),
+ 'priority' => 25,
+ 'theme_supports' => 'reactor-backgrounds',
) );
$wp_customize->add_setting('reactor_options[bg_color]', array(
- 'default' => '',
- 'type' => 'option',
- 'capability' => 'manage_options',
- 'transport' => 'postMessage',
+ 'default' => '',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-backgrounds',
'sanitize_callback' => 'maybe_hash_hex_color',
'sanitize_js_callback' => 'maybe_hash_hex_color',
) );
@@ -584,10 +622,11 @@ public function render_content() {
) ) );
$wp_customize->add_setting('reactor_options[bg_image]', array(
- 'default' => '',
- 'type' => 'option',
- 'capability' => 'manage_options',
- 'transport' => 'postMessage',
+ 'default' => '',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-backgrounds',
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'reactor_bg_image', array(
'label' => __('Background Image', 'reactor'),
@@ -596,10 +635,11 @@ public function render_content() {
) ) );
$wp_customize->add_setting('reactor_options[bg_repeat]', array(
- 'default' => 'repeat',
- 'type' => 'option',
- 'capability' => 'manage_options',
- 'transport' => 'postMessage',
+ 'default' => 'repeat',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-backgrounds',
) );
$wp_customize->add_control('reactor_options[bg_repeat]', array(
'label' => __('Image Repeat', 'reactor'),
@@ -614,10 +654,11 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[bg_position]', array(
- 'default' => 'left top',
- 'type' => 'option',
- 'capability' => 'manage_options',
- 'transport' => 'postMessage',
+ 'default' => 'left top',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-backgrounds',
) );
$wp_customize->add_control('reactor_options[bg_position]', array(
'label' => __('Image Position', 'reactor'),
@@ -637,10 +678,11 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[bg_attachment]', array(
- 'default' => 'scroll',
- 'type' => 'option',
- 'capability' => 'manage_options',
- 'transport' => 'postMessage',
+ 'default' => 'scroll',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-backgrounds',
) );
$wp_customize->add_control('reactor_options[bg_attachment]', array(
'label' => __('Image Attachment', 'reactor'),
@@ -650,20 +692,35 @@ public function render_content() {
'scroll' => __('Scroll', 'reactor'),
'fixed' => __('Fixed', 'reactor'),
),
- ) );
+ ) );
+
+ $wp_customize->add_setting('reactor_options[bg_full_window]', array(
+ 'default' => 0,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-backgrounds',
+ ) );
+ $wp_customize->add_control('reactor_options[bg_full_window]', array(
+ 'label' => __('Full Window Background', 'reactor'),
+ 'section' => 'reactor_customizer_background',
+ 'type' => 'checkbox',
+ ) );
// Fonts
$font_faces = array_merge(reactor_typography_get_os_fonts() , reactor_typography_get_google_fonts());
$wp_customize->add_section('reactor_customizer_fonts', array(
- 'title' => __('Fonts & Colors', 'reactor'),
- 'priority' => 30,
+ 'title' => __('Fonts & Colors', 'reactor'),
+ 'priority' => 30,
+ 'theme_supports' => 'reactor-fonts',
) );
$wp_customize->add_setting('reactor_options[content_font]', array(
- 'default' => "'Helvetica Neue', Helvetica, Arial, sans-serif",
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => "'Helvetica Neue', Helvetica, Arial, sans-serif",
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-fonts',
) );
$wp_customize->add_control('reactor_options[content_font]', array(
'label' => __('Content Font', 'reactor'),
@@ -673,9 +730,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[title_font]', array(
- 'default' => "'Open Sans', sans-serif",
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => "'Open Sans', sans-serif",
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-fonts',
) );
$wp_customize->add_control('reactor_options[title_font]', array(
'label' => __('Title Font', 'reactor'),
@@ -689,6 +747,7 @@ public function render_content() {
'type' => 'option',
'capability' => 'manage_options',
'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-fonts',
'sanitize_callback' => 'maybe_hash_hex_color',
'sanitize_js_callback' => 'maybe_hash_hex_color',
) );
@@ -703,6 +762,7 @@ public function render_content() {
'type' => 'option',
'capability' => 'manage_options',
'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-fonts',
'sanitize_callback' => 'maybe_hash_hex_color',
'sanitize_js_callback' => 'maybe_hash_hex_color',
) );
@@ -717,6 +777,7 @@ public function render_content() {
'type' => 'option',
'capability' => 'manage_options',
'transport' => 'postMessage',
+ 'theme_supports' => 'reactor-fonts',
'sanitize_callback' => 'maybe_hash_hex_color',
'sanitize_js_callback' => 'maybe_hash_hex_color',
) );
@@ -730,6 +791,7 @@ public function render_content() {
'default' => '',
'type' => 'option',
'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-fonts',
'sanitize_callback' => 'maybe_hash_hex_color',
'sanitize_js_callback' => 'maybe_hash_hex_color',
) );
@@ -741,14 +803,16 @@ public function render_content() {
// Login
$wp_customize->add_section('reactor_customizer_login', array(
- 'title' => __('Login', 'reactor'),
- 'priority' => 45,
+ 'title' => __('Login', 'reactor'),
+ 'priority' => 45,
+ 'theme_supports' => 'reactor-custom-login',
) );
$wp_customize->add_setting('reactor_options[login_logo]', array(
- 'default' => '',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => '',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-custom-login',
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'reactor_login_logo', array(
'label' => __('Login Logo', 'reactor'),
@@ -757,9 +821,10 @@ public function render_content() {
) ) );
$wp_customize->add_setting('reactor_options[login_logo_url]', array(
- 'default' => '',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => '',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-custom-login',
) );
$wp_customize->add_control('reactor_options[login_logo_url]', array(
'label' => __('Logo Link URL', 'reactor'),
@@ -768,9 +833,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[login_logo_title]', array(
- 'default' => '',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => '',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-custom-login',
) );
$wp_customize->add_control('reactor_options[login_logo_title]', array(
'label' => __('Logo Title Attribute', 'reactor'),
@@ -778,16 +844,26 @@ public function render_content() {
'type' => 'text',
) );
+
+ $templates = get_theme_support('reactor-page-templates');
+
+ if ( !is_array( $templates[0] ) ) {
+ $templates[0] = array();
+ }
+
// Front Page
+ if ( in_array( 'front-page', $templates[0] ) ) {
$wp_customize->add_section('frontpage_settings', array(
- 'title' => __('Front Page', 'reactor'),
- 'priority' => 50,
+ 'title' => __('Front Page', 'reactor'),
+ 'priority' => 50,
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_setting('reactor_options[frontpage_post_category]', array(
- 'default' => '',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => '',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control( new WP_Customize_Dropdown_Categories_Control( $wp_customize, 'reactor_frontpage_post_category', array(
'label' => __('Post Category', 'reactor'),
@@ -798,9 +874,10 @@ public function render_content() {
) ) );
$wp_customize->add_setting('reactor_options[frontpage_exclude_cat]', array(
- 'default' => 1,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 1,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[frontpage_exclude_cat]', array(
'label' => __('Exclude From Blog', 'reactor'),
@@ -810,9 +887,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[frontpage_slider_category]', array(
- 'default' => '',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => '',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => array('reactor-page-templates', 'reactor-post-types'),
) );
$wp_customize->add_control( new WP_Customize_Dropdown_Slide_Categories_Control( $wp_customize, 'reactor_frontpage_slider_category', array(
'label' => __('Slider Category', 'reactor'),
@@ -823,9 +901,10 @@ public function render_content() {
) ) );
$wp_customize->add_setting('reactor_options[frontpage_post_columns]', array(
- 'default' => '3',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => '3',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[frontpage_post_columns]', array(
'label' => __('Post Columns', 'reactor'),
@@ -840,30 +919,11 @@ public function render_content() {
'priority' => 4,
) );
- $wp_customize->add_setting('reactor_options[frontpage_page_layout]', array(
- 'default' => '0side-cm',
- 'type' => 'option',
- 'capability' => 'manage_options',
- ) );
- $wp_customize->add_control('reactor_options[frontpage_page_layout]', array(
- 'label' => __('Page Layout', 'reactor'),
- 'section' => 'frontpage_settings',
- 'type' => 'select',
- 'choices' => array(
- '0side-cm' => __('No Sidebars', 'reactor'),
- '1side-cl' => __('1 Sidebar - Content Left', 'reactor'),
- '1side-cr' => __('1 Sidebar - Content Right', 'reactor'),
- '2side-cl' => __('2 Sidebars - Content Left', 'reactor'),
- '2side-cr' => __('2 Sidebars - Content Right', 'reactor'),
- '2side-cm' => __('2 Sidebars - Content Middle', 'reactor'),
- ),
- 'priority' => 5,
- ) );
-
$wp_customize->add_setting('reactor_options[frontpage_number_posts]', array(
- 'default' => 3,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 3,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[frontpage_number_posts]', array(
'label' => __('Number of Posts', 'reactor'),
@@ -873,9 +933,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[frontpage_show_titles]', array(
- 'default' => 1,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 1,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[frontpage_show_titles]', array(
'label' => __('Show Post Titles', 'reactor'),
@@ -885,9 +946,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[frontpage_link_titles]', array(
- 'default' => 0,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 0,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[frontpage_link_titles]', array(
'label' => __('Link Post Titles', 'reactor'),
@@ -897,9 +959,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[frontpage_comment_link]', array(
- 'default' => 0,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 0,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[frontpage_comment_link]', array(
'label' => __('Show Comment Link', 'reactor'),
@@ -909,9 +972,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[frontpage_post_meta]', array(
- 'default' => 0,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 0,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => array('reactor-page-templates', 'reactor-post-meta'),
) );
$wp_customize->add_control('reactor_options[frontpage_post_meta]', array(
'label' => __('Show Post Meta', 'reactor'),
@@ -921,9 +985,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[frontpage_page_links]', array(
- 'default' => 0,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 0,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => array('reactor-page-templates', 'reactor-page-links'),
) );
$wp_customize->add_control('reactor_options[frontpage_page_links]', array(
'label' => __('Show Page Links', 'reactor'),
@@ -931,17 +996,21 @@ public function render_content() {
'type' => 'checkbox',
'priority' => 11,
) );
-
+ }
+
// News Page
+ if ( in_array( 'news-page', $templates[0] ) ) {
$wp_customize->add_section('newspage_settings', array(
- 'title' => __('News Page', 'reactor'),
- 'priority' => 55,
+ 'title' => __('News Page', 'reactor'),
+ 'priority' => 55,
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_setting('reactor_options[newspage_slider_category]', array(
- 'default' => '',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => '',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => array('reactor-page-templates', 'reactor-post-types'),
) );
$wp_customize->add_control( new WP_Customize_Dropdown_Slide_Categories_Control( $wp_customize, 'reactor_newspage_slider_category', array(
'label' => __('Slider Category', 'reactor'),
@@ -952,9 +1021,10 @@ public function render_content() {
) ) );
$wp_customize->add_setting('reactor_options[newspage_post_columns]', array(
- 'default' => '2',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => '2',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[newspage_post_columns]', array(
'label' => __('Post Columns', 'reactor'),
@@ -966,32 +1036,13 @@ public function render_content() {
'3' => __('3 Columns', 'reactor'),
),
'priority' => 2,
- ) );
-
- $wp_customize->add_setting('reactor_options[newspage_page_layout]', array(
- 'default' => '1side-cl',
- 'type' => 'option',
- 'capability' => 'manage_options',
- ) );
- $wp_customize->add_control('reactor_options[newspage_page_layout]', array(
- 'label' => __('Page Layout', 'reactor'),
- 'section' => 'newspage_settings',
- 'type' => 'select',
- 'choices' => array(
- '0side-cm' => __('No Sidebars', 'reactor'),
- '1side-cl' => __('1 Sidebar - Content Left', 'reactor'),
- '1side-cr' => __('1 Sidebar - Content Right', 'reactor'),
- '2side-cl' => __('2 Sidebars - Content Left', 'reactor'),
- '2side-cr' => __('2 Sidebars - Content Right', 'reactor'),
- '2side-cm' => __('2 Sidebars - Content Middle', 'reactor'),
- ),
- 'priority' => 3,
- ) );
+ ) );
$wp_customize->add_setting('reactor_options[newspage_number_posts]', array(
- 'default' => get_option('posts_per_page'),
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => get_option('posts_per_page'),
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[newspage_number_posts]', array(
'label' => __('Number of Posts', 'reactor'),
@@ -1001,9 +1052,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[newspage_post_meta]', array(
- 'default' => 1,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 1,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => array('reactor-page-templates', 'reactor-post-meta'),
) );
$wp_customize->add_control('reactor_options[newspage_post_meta]', array(
'label' => __('Show Post Meta', 'reactor'),
@@ -1013,9 +1065,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[newspage_comment_link]', array(
- 'default' => 1,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 1,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[newspage_comment_link]', array(
'label' => __('Show Comment Link', 'reactor'),
@@ -1023,37 +1076,21 @@ public function render_content() {
'type' => 'checkbox',
'priority' => 6,
) );
-
+ }
+
// Contact Page
+ if ( in_array( 'contact', $templates[0] ) ) {
$wp_customize->add_section('contactpage_settings', array(
- 'title' => __('Contact Page', 'reactor'),
- 'priority' => 60,
+ 'title' => __('Contact Page', 'reactor'),
+ 'priority' => 60,
+ 'theme_supports' => 'reactor-page-templates'
) );
-
- $wp_customize->add_setting('reactor_options[contact_page_layout]', array(
- 'default' => '1side-cl',
- 'type' => 'option',
- 'capability' => 'manage_options',
- ) );
- $wp_customize->add_control('reactor_options[contact_page_layout]', array(
- 'label' => __('Page Layout', 'reactor'),
- 'section' => 'contactpage_settings',
- 'type' => 'select',
- 'choices' => array(
- '0side-cm' => __('No Sidebars', 'reactor'),
- '1side-cl' => __('1 Sidebar - Content Left', 'reactor'),
- '1side-cr' => __('1 Sidebar - Content Right', 'reactor'),
- '2side-cl' => __('2 Sidebars - Content Left', 'reactor'),
- '2side-cr' => __('2 Sidebars - Content Right', 'reactor'),
- '2side-cm' => __('2 Sidebars - Content Middle', 'reactor'),
- ),
- 'priority' => 1,
- ) );
$wp_customize->add_setting('reactor_options[contact_email_to]', array(
- 'default' => get_option('admin_email'),
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => get_option('admin_email'),
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[contact_email_to]', array(
'label' => __('Email Address', 'reactor'),
@@ -1063,9 +1100,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[contact_email_subject]', array(
- 'default' => get_bloginfo('name') . __(' - Contact Form Message', 'reactor'),
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => get_bloginfo('name') . __(' - Contact Form Message', 'reactor'),
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[contact_email_subject]', array(
'label' => __('Email Subject', 'reactor'),
@@ -1075,9 +1113,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[contact_email_sent]', array(
- 'default' => __('Thank you! Your email was sent successfully.', 'reactor'),
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => __('Thank you! Your email was sent successfully.', 'reactor'),
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[contact_email_sent]', array(
'label' => __('Send Successful Message', 'reactor'),
@@ -1085,17 +1124,21 @@ public function render_content() {
'type' => 'text',
'priority' => 4,
) );
+ }
// Portfolio
+ if ( in_array( 'portfolio', $templates[0] ) ) {
$wp_customize->add_section('portfolio_settings', array(
- 'title' => __('Portfolio Page', 'reactor'),
- 'priority' => 65,
+ 'title' => __('Portfolio Page', 'reactor'),
+ 'priority' => 65,
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_setting('reactor_options[portfolio_post_columns]', array(
- 'default' => '4',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => '4',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[portfolio_post_columns]', array(
'label' => __('Post Columns', 'reactor'),
@@ -1109,31 +1152,12 @@ public function render_content() {
),
'priority' => 2,
) );
-
- $wp_customize->add_setting('reactor_options[portfolio_page_layout]', array(
- 'default' => '0side-cm',
- 'type' => 'option',
- 'capability' => 'manage_options',
- ) );
- $wp_customize->add_control('reactor_options[portfolio_page_layout]', array(
- 'label' => __('Page Layout', 'reactor'),
- 'section' => 'portfolio_settings',
- 'type' => 'select',
- 'choices' => array(
- '0side-cm' => __('No Sidebars', 'reactor'),
- '1side-cl' => __('1 Sidebar - Content Left', 'reactor'),
- '1side-cr' => __('1 Sidebar - Content Right', 'reactor'),
- '2side-cl' => __('2 Sidebars - Content Left', 'reactor'),
- '2side-cr' => __('2 Sidebars - Content Right', 'reactor'),
- '2side-cm' => __('2 Sidebars - Content Middle', 'reactor'),
- ),
- 'priority' => 3,
- ) );
$wp_customize->add_setting('reactor_options[portfolio_number_posts]', array(
- 'default' => 20,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 20,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[portfolio_number_posts]', array(
'label' => __('Number of Posts', 'reactor'),
@@ -1143,9 +1167,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[portfolio_filter_type]', array(
- 'default' => 'jquery',
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 'jquery',
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[portfolio_filter_type]', array(
'label' => __('Filter Type', 'reactor'),
@@ -1159,9 +1184,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[portfolio_show_titles]', array(
- 'default' => 1,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 1,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[portfolio_show_titles]', array(
'label' => __('Show Titles', 'reactor'),
@@ -1171,9 +1197,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[portfolio_link_titles]', array(
- 'default' => 1,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 1,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => 'reactor-page-templates'
) );
$wp_customize->add_control('reactor_options[portfolio_link_titles]', array(
'label' => __('Link Titles', 'reactor'),
@@ -1183,9 +1210,10 @@ public function render_content() {
) );
$wp_customize->add_setting('reactor_options[portfolio_post_meta]', array(
- 'default' => 0,
- 'type' => 'option',
- 'capability' => 'manage_options',
+ 'default' => 0,
+ 'type' => 'option',
+ 'capability' => 'manage_options',
+ 'theme_supports' => array('reactor-page-templates', 'reactor-post-meta'),
) );
$wp_customize->add_control('reactor_options[portfolio_post_meta]', array(
'label' => __('Show Meta', 'reactor'),
@@ -1193,7 +1221,8 @@ public function render_content() {
'type' => 'checkbox',
'priority' => 8,
) );
-
+ }
+
}
}
?>
View
309 library/inc/extensions/menus.php
@@ -11,187 +11,160 @@
* @link http://codex.wordpress.org/Function_Reference/wp_nav_menu
* @license GNU General Public License v2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
*/
+add_action('init', 'reactor_register_menus');
-if ( !function_exists('reactor_register_menus') ) {
- function reactor_register_menus() {
+function reactor_register_menus() {
+
+ /**
+ * Register navigation menus for a theme.
+ *
+ * @since 1.0.0
+ * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
+ */
+ $menus = get_theme_support( 'reactor-menus' );
+
+ if ( !is_array( $menus[0] ) ) {
+ return;
+ }
+
+ if ( in_array('top-bar-l', $menus[0] ) ) {
+ register_nav_menu('top-bar-l', __( 'Top Bar Left', 'reactor'));
+ }
+
+ if ( in_array( 'top-bar-r', $menus[0] ) ) {
+ register_nav_menu('top-bar-r', __( 'Top Bar Right', 'reactor'));
+ }
+
+ if ( in_array( 'main-menu', $menus[0] ) ) {
+ register_nav_menu('main-menu', __( 'Main Menu', 'reactor'));
+ }
+
+ if ( in_array( 'side-menu', $menus[0] ) ) {
+ register_nav_menu('side-menu', __( 'Side Menu', 'reactor'));
+ }
+
+ if ( in_array( 'footer-links', $menus[0] ) ) {
+ register_nav_menu('footer-links', __( 'Footer Links', 'reactor'));
+ }
- /**
- * Top bar left menu
- *
- * @since 1.0.0
- * @see wp_nav_menu
- * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
- */
- if ( !function_exists('reactor_top_bar_l') ) {
- function reactor_top_bar_l() {
- $defaults = array(
- 'theme_location' => 'top-bar-l',
- 'menu' => '',
- 'container' => false,
- 'container_class' => '',
- 'container_id' => '',
- 'menu_class' => 'top-bar-menu left',
- 'menu_id' => '',
- 'echo' => 0,
- 'fallback_cb' => false,
- 'before' => '',
- 'after' => '',
- 'link_before' => '',
- 'link_after' => '',
- 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
- 'depth' => 0,
- 'walker' => new Top_Bar_Walker()
- );
- return wp_nav_menu( $defaults );
- }
+ /**
+ * Top bar left menu
+ *
+ * @since 1.0.0
+ * @see wp_nav_menu
+ * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
+ */
+ if ( !function_exists('reactor_top_bar_l') ) {
+ function reactor_top_bar_l() {
+ $defaults = array(
+ 'theme_location' => 'top-bar-l',
+ 'container' => false,
+ 'menu_class' => 'top-bar-menu left',
+ 'echo' => 0,
+ 'fallback_cb' => false,
+ 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
+ 'depth' => 0,
+ 'walker' => new Top_Bar_Walker()
+ );
+ return wp_nav_menu( $defaults );
}
-
- /**
- * Top bar right menu
- *
- * @since 1.0.0
- * @see wp_nav_menu
- * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
- */
- if ( !function_exists('reactor_top_bar_r') ) {
- function reactor_top_bar_r() {
- $defaults = array(
- 'theme_location' => 'top-bar-r',
- 'menu' => '',
- 'container' => false,
- 'container_class' => '',
- 'container_id' => '',
- 'menu_class' => 'top-bar-menu right',
- 'menu_id' => '',
- 'echo' => 0,
- 'fallback_cb' => false,
- 'before' => '',
- 'after' => '',
- 'link_before' => '',
- 'link_after' => '',
- 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
- 'depth' => 0,
- 'walker' => new Top_Bar_Walker()
- );
- return wp_nav_menu( $defaults );
- }
+ }
+
+ /**
+ * Top bar right menu
+ *
+ * @since 1.0.0
+ * @see wp_nav_menu
+ * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
+ */
+ if ( !function_exists('reactor_top_bar_r') ) {
+ function reactor_top_bar_r() {
+ $defaults = array(
+ 'theme_location' => 'top-bar-r',
+ 'container' => false,
+ 'menu_class' => 'top-bar-menu right',
+ 'echo' => 0,
+ 'fallback_cb' => false,
+ 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
+ 'depth' => 0,
+ 'walker' => new Top_Bar_Walker()
+ );
+ return wp_nav_menu( $defaults );
}
+ }
- /**
- * Main menu
- *
- * @since 1.0.0
- * @see wp_nav_menu
- * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
- */
- if ( !function_exists('reactor_main_menu') ) {
- function reactor_main_menu() {
- $defaults = array(
- 'theme_location' => 'main-menu',
- 'menu' => '',
- 'container' => false,
- 'container_class' => '',
- 'container_id' => '',
- 'menu_class' => 'nav-bar',
- 'menu_id' => '',
- 'echo' => true,
- 'fallback_cb' => false,
- 'before' => '',
- 'after' => '',
- 'link_before' => '',
- 'link_after' => '',
- 'items_wrap' => '%3$s',
- 'depth' => 2,
- 'walker' => new Nav_Bar_Walker()
- );
- wp_nav_menu( $defaults );
- }
+ /**
+ * Main menu
+ *
+ * @since 1.0.0
+ * @see wp_nav_menu
+ * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
+ */
+ if ( !function_exists('reactor_main_menu') ) {
+ function reactor_main_menu() {
+ $defaults = array(
+ 'theme_location' => 'main-menu',
+ 'container' => false,
+ 'menu_class' => 'nav-bar',
+ 'echo' => true,
+ 'fallback_cb' => false,
+ 'items_wrap' => '%3$s',
+ 'depth' => 2,
+ 'walker' => new Nav_Bar_Walker()
+ );
+ wp_nav_menu( $defaults );
}
+ }
- /**
- * Side menu
- *
- * @since 1.0.0
- * @see wp_nav_menu
- * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
- */
- if ( !function_exists('reactor_side_menu') ) {
- function reactor_side_menu() {
- $side_nav_type = reactor_option('side_nav_type', 'accordion');
- $side_nav_walker = new Vertical_Nav_Walker();
- $items_wrap = ( 'side_nav' == $side_nav_type ) ? '<ul id="%1$s" class="%2$s">%3$s</ul>' : '%3$s';
- $walker = ( 'side_nav' == $side_nav_type ) ? '' : $side_nav_walker;
- $depth = ( 'side_nav' == $side_nav_type ) ? 1 : 2;
-
- $defaults = array(
- 'theme_location' => 'side-menu',
- 'menu' => '',
- 'container' => 'ul',
- 'container_class' => '',
- 'container_id' => '',
- 'menu_class' => 'side-nav',
- 'menu_id' => '',
- 'echo' => true,
- 'fallback_cb' => false,
- 'before' => '',
- 'after' => '',
- 'link_before' => '',
- 'link_after' => '',
- 'items_wrap' => $items_wrap,
- 'depth' => $depth,
- 'walker' => $walker
- );
- wp_nav_menu( $defaults );
- }
- }
-
- /**
- * Footer menu
- *
- * @since 1.0.0
- * @see wp_nav_menu
- * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
- */
- if ( !function_exists('reactor_footer_links') ) {
- function reactor_footer_links() {
- $defaults = array(
- 'theme_location' => 'footer-links',
- 'menu' => '',
- 'container' => false,
- 'container_class' => '',
- 'container_id' => '',
- 'menu_class' => 'inline-list',
- 'menu_id' => '',
- 'echo' => true,
- 'fallback_cb' => false,
- 'before' => '',
- 'after' => '',
- 'link_before' => '',
- 'link_after' => '',
- 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
- 'depth' => 1,
- 'walker' => ''
- );
- wp_nav_menu( $defaults );
- }
+ /**
+ * Side menu
+ *
+ * @since 1.0.0
+ * @see wp_nav_menu
+ * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
+ */
+ if ( !function_exists('reactor_side_menu') ) {
+ function reactor_side_menu() {
+ $side_nav_type = reactor_option('side_nav_type', 'accordion');
+ $side_nav_walker = new Vertical_Nav_Walker();
+ $items_wrap = ( 'side_nav' == $side_nav_type ) ? '<ul id="%1$s" class="%2$s">%3$s</ul>' : '%3$s';
+ $walker = ( 'side_nav' == $side_nav_type ) ? '' : $side_nav_walker;
+ $depth = ( 'side_nav' == $side_nav_type ) ? 1 : 2;
+
+ $defaults = array(
+ 'theme_location' => 'side-menu',
+ 'container' => 'ul',
+ 'menu_class' => 'side-nav',
+ 'echo' => true,
+ 'fallback_cb' => false,
+ 'items_wrap' => $items_wrap,
+ 'depth' => $depth,
+ 'walker' => $walker
+ );
+ wp_nav_menu( $defaults );
}
}
- /**
- * Register navigation menus for a theme.
+ /**
+ * Footer menu
*
* @since 1.0.0
+ * @see wp_nav_menu
* @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
*/
- register_nav_menus(
- array(
- 'top-bar-l' => __('Top Bar Left', 'reactor'),
- 'top-bar-r' => __('Top Bar Right', 'reactor'),
- 'main-menu' => __('Main Menu', 'reactor'),
- 'side-menu' => __('Side Menu', 'reactor'),
- 'footer-links' => __('Footer Links', 'reactor')
- )
- );
+ if ( !function_exists('reactor_footer_links') ) {
+ function reactor_footer_links() {
+ $defaults = array(
+ 'theme_location' => 'footer-links',
+ 'container' => false,
+ 'menu_class' => 'inline-list',
+ 'echo' => true,
+ 'fallback_cb' => false,
+ 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
+ 'depth' => 1,
+ );
+ wp_nav_menu( $defaults );
+ }
+ }
- add_action('after_setup_theme', 'reactor_register_menus', 12);
}
View
421 library/inc/extensions/post-types.php
@@ -11,209 +11,224 @@
* @license GNU General Public License v2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
*/
-/**
- * Register slide post type
- * Do not use before init
- *
- * @see register_post_type
- * @since 1.0.0
- */
-function reactor_slide_register() {
-
- $labels = array(
- 'name' => __('Slideshow', 'reactor'),
- 'singular_name' => __('Slide', 'reactor'),
- 'add_new' => __('Add New', 'reactor'),
- 'add_new_item' => __('Add New Slide', 'reactor'),
- 'edit_item' => __('Edit Slide', 'reactor'),
- 'new_item' => __('New Slide', 'reactor'),
- 'all_items' => __('All Slides', 'reactor'),
- 'view_item' => __('View Slide', 'reactor'),
- 'search_items' => __('Search Slides', 'reactor'),
- 'not_found' => __('Nothing found', 'reactor'),
- 'not_found_in_trash' => __('Nothing found in Trash', 'reactor'),
- 'parent_item_colon' => '',
- 'menu_name' => __('Slides', 'reactor')
- );
-
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'menu_icon' => get_template_directory_uri() . '/library/img/admin/admin-slides.png',
- 'rewrite' => true,
- 'capability_type' => 'post',
- 'taxonomies' => array('slide-category'),
- 'has_archive' => false,
- 'hierarchical' => false,
- 'menu_position' => 7,
- 'rewrite' => array(
- 'slug' => __('slideshow-post', 'reactor'),
- 'with_front' => false,
- 'feed' => true,
- 'pages' => true ),
- 'supports' => array('title','editor','thumbnail', 'excerpt')
- );
+
+add_action('after_setup_theme', 'reactor_register_post_types', 16);
- register_post_type('slide' , $args );
-}
-add_action('init', 'reactor_slide_register');
+function reactor_register_post_types() {
+ $post_types = get_theme_support('reactor-post-types');
-/**
- * Create slide taxonomies
- * Do not use before init
- *
- * @link http://codex.wordpress.org/Function_Reference/register_taxonomy
- * @see register_taxonomy
- * @since 1.0.0
- */
-function reactor_slide_taxonomies() {
- // Add new taxonomy, make it hierarchical ( like categories )
- $labels = array(
- 'name' => __('Slide Categories', 'reactor'),
- 'singular_name' => __('Slide Category', 'reactor'),
- 'search_items' => __('Search Slide Categories', 'reactor'),
- 'all_items' => __('All Slide Categories', 'reactor'),
- 'parent_item' => __('Parent Slide Category', 'reactor'),
- 'parent_item_colon' => __('Parent Slide Category:', 'reactor'),
- 'edit_item' => __('Edit Slide Category', 'reactor'),
- 'update_item' => __('Update Slide Category', 'reactor'),
- 'add_new_item' => __('Add New Slide Category', 'reactor'),
- 'new_item_name' => __('New Slide Category Name', 'reactor'),
- 'menu_name' => __('Categories', 'reactor'),
- );
-
- register_taxonomy('slide-category', array('slide'),
- array(
- 'hierarchical' => true,
- 'labels' => $labels,
- 'show_ui' => true,
- 'show_admin_column'<