'Main Menu' // 'footer' => 'Footer Menu' )); /* ================================================================================== */ /* Theme Supports /* ================================================================================== */ add_action('after_setup_theme', 'themewaves_setup'); if (!function_exists('themewaves_setup')) { function themewaves_setup() { add_editor_style(); add_theme_support('post-thumbnails'); add_theme_support('automatic-feed-links'); load_theme_textdomain('themewaves', THEME_PATH . '/languages/'); } } if (!isset($content_width)) $content_width = 960; /* ================================================================================== */ /* Enqueue Scripts /* ================================================================================== */ add_action('wp_enqueue_scripts', 'themewaves_scripts'); function themewaves_scripts() { wp_enqueue_style('bootstrap', THEME_DIR . '/assets/css/bootstrap.min.css'); wp_enqueue_style('responsive', THEME_DIR . '/assets/css/bootstrap-responsive.min.css'); wp_enqueue_style('prettyphoto', THEME_DIR . '/assets/css/prettyPhoto.css'); wp_enqueue_style('fontawesome', THEME_DIR . '/assets/css/font-awesome/font-awesome.min.css'); wp_enqueue_style('themewaves', STYLESHEET_DIR . '/style.css'); wp_enqueue_style('animate', THEME_DIR . '/assets/css/animate-custom.css'); wp_enqueue_style('tw-responsive', THEME_DIR . '/assets/css/responsive.css'); $protocol = is_ssl() ? 'https' : 'http'; $defaultfonts = array( 'Helvetica Neue', 'Verdana, Geneva', 'Trebuchet', 'Georgia', 'Times New Roman', 'Tahoma, Geneva', 'Palatino'); $tw_googlefonts = array( tw_option('body_text_font','face'), tw_option('sidebar_widgets_title','face'), tw_option('footer_widgets_title','face'), tw_option('heading_font'), ); $googlefont = ''; foreach($tw_googlefonts as $font) { if(!in_array($font, $defaultfonts)) { $googlefont = str_replace(' ', '+', $font). ':400,400italic,700,700italic|' . $googlefont; } } if($googlefont != '') wp_enqueue_style('google-font', "$protocol://fonts.googleapis.com/css?family=" . substr_replace($googlefont ,"",-1) . "&subset=".tw_option('google_font_subset')); //wp_enqueue_style('google-font', "$protocol://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic,700italic"); wp_enqueue_script('jquery'); if ( is_single() && comments_open() ) wp_enqueue_script( 'comment-reply' ); wp_enqueue_script('superfish', THEME_DIR . '/assets/js/superfish.js', false, false, true); wp_enqueue_script('prettyphoto', THEME_DIR . '/assets/js/jquery.prettyPhoto.js', false, false, true); wp_enqueue_script('fredcarousel', THEME_DIR . '/assets/js/jquery.carouFredSel-6.2.1-packed.js', false, false, true); wp_enqueue_script('bootstrap', THEME_DIR . '/assets/js/bootstrap.min.js', false, false, true); wp_enqueue_script('themewaves', THEME_DIR . '/assets/js/themewaves.js', false, false, true); } /* ================================================================================== */ /* Register Widget Sidebar /* ================================================================================== */ if (!function_exists('theme_widgets_init')) { function theme_widgets_init() { register_sidebar(array( 'name' => 'Default sidebar', 'id' => 'default-sidebar', 'before_widget' => '', 'before_title' => '
', )); /* footer sidebar */ $grid = tw_option('footer_layout')!="" ? tw_option('footer_layout') : '3-3-3-3'; $i = 1; foreach (split('-', $grid) as $g) { register_sidebar(array( 'name' => __("Footer sidebar ", "themewaves") . $i, 'id' => "footer-sidebar-$i", 'description' => __('The footer sidebar widget area', 'themewaves'), 'before_widget' => '', 'before_title' => ' ', )); $i++; } } } add_action('widgets_init', 'theme_widgets_init'); add_filter('widget_text', 'do_shortcode'); /* ================================================================================== */ /* Has more in post /* ================================================================================== */ function has_more() { global $post; if (empty($post)) return; return (bool) preg_match('//', $post->post_content); } /* ================================================================================== */ /* Exclude pages from search /* ================================================================================== */ if (!function_exists('exclude_pages_from_search')) : function exclude_pages_from_search($query) { if ($query->is_search) { $query->set('post_type', array('post', 'portfolio', 'page')); } return $query; } add_filter('pre_get_posts', 'exclude_pages_from_search'); endif; /* ================================================================================== */ /* Support upload .ico file /* ================================================================================== */ if (!function_exists('custom_upload_mimes')) { add_filter('upload_mimes', 'custom_upload_mimes'); function custom_upload_mimes($existing_mimes = array()) { $existing_mimes['ico'] = "image/x-icon"; return $existing_mimes; } } /* ================================================================================== */ /* ThemeWaves Search Form Customize /* ================================================================================== */ function my_search_form() { $form = ''; return $form; } add_filter('get_search_form', 'my_search_form'); /* ================================================================================== */ /* IE /* ================================================================================== */ function my_render_css3_pie() { echo ' '; } //add_action('wp_head', 'my_render_css3_pie', 8); add_filter("wpcf7_mail_tag_replaced", "suppress_wpcf7_filter"); function suppress_wpcf7_filter($value, $sub = "") { $out = !empty($sub) ? $sub : $value; $out = strip_tags($out); $out = wptexturize($out); return $out; } function wpex_fix_shortcodes($content){ $array = array ( ']