'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 = '
'; if (is_search()) { $form .=''; } else { $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' => '

', 'after_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' => '

', 'after_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' => '

', 'after_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') { ?>
  • -

    ' . ' ' . ( $req ? '*
    ' : '' ) . '

    '; $fields['email'] = ''; $fields['url'] = '


    ' . '

    '; return $fields; } } /* **************************************************************************************************** */ // Modify Avatar Classes /* **************************************************************************************************** */ add_filter('get_avatar','nimbus_avatar_class'); if (!function_exists('nimbus_avatar_class')){ function nimbus_avatar_class($class) { $class = str_replace("class='avatar", "class='avatar img-responsive", $class) ; return $class; } } /* **************************************************************************************************** */ // Add Post Link Classes /* **************************************************************************************************** */ add_filter('next_post_link', 'nimbus_posts_link_next_class'); if (!function_exists('nimbus_posts_link_next_class')){ function nimbus_posts_link_next_class($format){ $format = str_replace('href=', 'class="post_next btn" href=', $format); return $format; } } add_filter('previous_post_link', 'nimbus_posts_link_prev_class'); if (!function_exists('nimbus_posts_link_prev_class')){ function nimbus_posts_link_prev_class($format) { $format = str_replace('href=', 'class="post_prev btn" href=', $format); return $format; } } /* **************************************************************************************************** */ // Add next_posts Link Classes /* **************************************************************************************************** */ add_filter('next_posts_link_attributes', 'nimbus_posts_link_class'); add_filter('previous_posts_link_attributes', 'nimbus_posts_link_class'); if (!function_exists('nimbus_posts_link_class')){ function nimbus_posts_link_class() { return 'class="btn"'; } } /* **************************************************************************************************** */ // Add Image Classes ##Look for way to apply to exsisting /* **************************************************************************************************** */ add_filter('get_image_tag_class','nimbus_add_image_class'); if (!function_exists('nimbus_add_image_class')){ function nimbus_add_image_class($class){ $class .= ' img-responsive'; return $class; } } /* **************************************************************************************************** */ // Load Public Scripts /* **************************************************************************************************** */ add_action('wp_enqueue_scripts', 'nimbus_public_scripts'); if (!function_exists('nimbus_public_scripts')){ function nimbus_public_scripts() { if (!is_admin()) { wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array('jquery'), '2.2.2', true); wp_enqueue_script('waypoints', get_template_directory_uri() . '/assets/js/jquery.waypoints.min.js', array('jquery'), '2.2.2', true); wp_enqueue_script('nicescroll', get_template_directory_uri() . '/assets/js/nicescroll.min.js', array('jquery'), '3.6.0', true); wp_enqueue_script('parallax',get_template_directory_uri() . '/assets/js/parallax.min.js','','1.3.1',true); wp_enqueue_script('scrollreveal',get_template_directory_uri() . '/assets/js/scrollReveal.min.js','','2.3.2',true); wp_enqueue_script('easing',get_template_directory_uri() . '/assets/js/jquery.easing.min.js','','1.3.0',true); wp_enqueue_script('public', get_template_directory_uri() . '/assets/js/public.js', array(), '2.0.0', true); } } } /* **************************************************************************************************** */ // Load Public Scripts in Conditional /* **************************************************************************************************** */ add_action('wp_head', 'nimbus_public_scripts_conditional'); if (!function_exists('nimbus_public_scripts_conditional')){ function nimbus_public_scripts_conditional() { ?> "; } /* **************************************************************************************************** */ // WooCommerce Support /* **************************************************************************************************** */ remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); add_action('woocommerce_before_main_content', 'nimbus_wrapper_start', 10); add_action('woocommerce_after_main_content', 'nimbus_wrapper_end', 10); function nimbus_wrapper_start() { echo '
    '; } function nimbus_wrapper_end() { echo '
    '; } /* **************************************************************************************************** */ // Scrollto in footer /* **************************************************************************************************** */ add_action('wp_footer', 'nimbus_contact_js', 99); function nimbus_contact_js() { global $post; if(isset($_POST['submitted'])) { ?>