'ffffff'
);
add_theme_support( 'custom-background', $nimbus_custom_background_defaults );
// Set Content Width
global $content_width;
if ( ! isset( $content_width ) ) {
$content_width = 720;
}
// Register Menus
register_nav_menu('primary', __('Primary Menu', 'wp-simple' ));
// Support title tag
add_theme_support( "title-tag" );
// Woo Support
add_theme_support( 'woocommerce' );
}
}
/* **************************************************************************************************** */
// Load Admin Panel
/* **************************************************************************************************** */
require_once(get_template_directory() . '/inc/kirki/kirki.php' );
require_once(get_template_directory() . '/inc/options.php' );
// Duplicate and import any theme options from <= 2.0.4
$mod=get_option( 'theme_mods_wp-simple' );
if ($mod) {
if (isset( $mod['nimbus_simple_options'] )) {
$newmod = array();
foreach ($mod['nimbus_simple_options'] as $key => $value) {
if (isset($value['url'])){
$value = $value['url'];
}
$newmod[$key] = $value;
}
add_option( 'theme_mods_wp-simple_backup', $mod, '', 'yes');
delete_option( 'theme_mods_wp-simple' );
add_option( 'theme_mods_wp-simple', $newmod, '', 'yes');
}
}
// Get Options
function nimbus_get_option($optionID, $default_data = false) {
if (get_theme_mod( $optionID )) {
return get_theme_mod( $optionID );
} else {
return NULL;
}
}
/* **************************************************************************************************** */
// Meta Boxes
/* **************************************************************************************************** */
require_once(get_template_directory() . '/inc/meta_boxes.php');
/* **************************************************************************************************** */
// Custom Widgets
/* **************************************************************************************************** */
require_once(get_template_directory() . '/inc/widgets.php');
/* **************************************************************************************************** */
// Custom NavWalker
/* **************************************************************************************************** */
require_once(get_template_directory() . '/inc/wp_bootstrap_navwalker.php');
/* **************************************************************************************************** */
// Modify Search Form
/* **************************************************************************************************** */
if (!function_exists('nimbus_modify_search_form')){
function nimbus_modify_search_form($form) {
$form = '
';
return $form;
}
}
add_filter('get_search_form', 'nimbus_modify_search_form');
/* **************************************************************************************************** */
// Override gallery style
/* **************************************************************************************************** */
add_filter( 'use_default_gallery_style', '__return_false' );
/* **************************************************************************************************** */
// Register Sidebars
/* **************************************************************************************************** */
add_action('widgets_init', 'nimbus_register_sidebars');
if (!function_exists('nimbus_register_sidebars')){
function nimbus_register_sidebars() {
// frontpage - about
register_sidebar(array(
'id' => 'frontpage-about-left',
'name' => __('Frontpage About Left', 'wp-simple' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
register_sidebar(array(
'id' => 'frontpage-about-center',
'name' => __('Frontpage About Center', 'wp-simple' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
register_sidebar(array(
'id' => 'frontpage-about-right',
'name' => __('Frontpage About Right', 'wp-simple' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
// frontpage - team - left
register_sidebar(array(
'id' => 'frontpage-team-left',
'name' => __('Frontpage Team Left', 'wp-simple' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
// frontpage - team - center left
register_sidebar(array(
'id' => 'frontpage-team-center-left',
'name' => __('Frontpage Team Center Left', 'wp-simple' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
// frontpage - team - center right
register_sidebar(array(
'id' => 'frontpage-team-center-right',
'name' => __('Frontpage Team Center Right', 'wp-simple' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
// frontpage - team - right
register_sidebar(array(
'id' => 'frontpage-team-right',
'name' => __('Frontpage Team Right', 'wp-simple' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
// frontpage - social
register_sidebar(array(
'id' => 'frontpage-social-media',
'name' => __('Frontpage Social Media', 'wp-simple' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => ''
));
register_sidebar(array(
'name' => __('Default Page Sidebar', 'wp-simple' ),
'id' => 'sidebar_pages',
'description' => __('Widgets in this area will be displayed in the sidebar on the pages.', 'wp-simple' ),
'before_widget' => '',
'before_title' => ''
));
register_sidebar(array(
'name' => __('Default Blog Sidebar', 'wp-simple' ),
'id' => 'sidebar_blog',
'description' => __('Widgets in this area will be displayed in the sidebar on the blog and posts.', 'wp-simple' ),
'before_widget' => '',
'before_title' => ''
));
// create 50 alternate sidebar widget areas for use on post and pages
$i = 1;
while ($i <= 10) {
register_sidebar(array(
'name' => __('Alternate Sidebar #', 'wp-simple' ) . $i,
'id' => 'sidebar_' . $i,
'description' => __('Widgets in this area will be displayed in the sidebar for any posts, pages or portfolio items that are taged with sidebar', 'wp-simple' ) . $i . '.',
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
));
$i++;
}
}
}
/* **************************************************************************************************** */
// Excerpt Modifications
/* **************************************************************************************************** */
// Excerpt Length
add_filter('excerpt_length', 'nimbus_excerpt_length');
if (!function_exists('nimbus_excerpt_length')){
function nimbus_excerpt_length($length) {
return 40;
}
}
// Excerpt More
add_filter('excerpt_more', 'nimbus_excerpt_more');
if (!function_exists('nimbus_excerpt_more')){
function nimbus_excerpt_more($more) {
return '';
}
}
// Add to pages
add_action('init', 'nimbus_add_excerpts_to_pages');
if (!function_exists('nimbus_add_excerpts_to_pages')){
function nimbus_add_excerpts_to_pages() {
add_post_type_support('page', 'excerpt');
}
}
// Get my ID
function nimbus_get_the_excerpt_by_id($post_id) {
global $post;
$save_post = $post;
$post = get_post($post_id);
$output = get_the_excerpt();
$post = $save_post;
return $output;
}
/* **************************************************************************************************** */
// Enable Threaded Comments
/* **************************************************************************************************** */
add_action('wp_enqueue_scripts', 'nimbus_threaded_comments');
function nimbus_threaded_comments() {
if (is_singular() && comments_open() && (get_option('thread_comments') == 1)) {
wp_enqueue_script('comment-reply');
}
}
/* **************************************************************************************************** */
// Modify Comments Output
/* **************************************************************************************************** */
if (!function_exists('nimbus_comment')){
function nimbus_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
id="li_comment_">
__('Leave a Reply', 'wp-simple' ), 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
comment_approved == '0') { ?>