'ffffff', 'default-image' => '', ) ) ); /* Add Menu Support */ add_theme_support('menus'); register_nav_menus( array( 'main-menu' => __('Main Menu', 'ascent') ) ); /* Add Post Thumbnails Support and Related Image Sizes */ add_image_size('blog-page', 732, 9999, false); // For Blog Page add_image_size('default-page', 1140, 9999, false); // Default Page and Full Width Page add_image_size('blog-post-thumb', 732, 447, true); // For Home Blog Section and Gallery Slider on Single and Blog Page /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If you're building a theme based on ascent, use a find and replace * to change 'ascent' to the name of your theme in all the template files */ load_theme_textdomain( 'ascent', get_template_directory() . '/languages' ); } endif; // ascent_setup add_action( 'after_setup_theme', 'ascent_setup' ); /** * Register widgetized area and update sidebar with default widgets */ function ascent_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'ascent' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Sidebar Footer', 'ascent' ), 'id' => 'sidebar-footer', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'ascent_widgets_init' ); /** * Enqueue scripts and styles * */ function ascent_scripts() { $protocol = is_ssl() ? 'https' : 'http'; wp_enqueue_style('google-raleway', "$protocol://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800"); // load bootstrap css wp_enqueue_style( 'ascent-bootstrap', get_template_directory_uri() . '/includes/resources/bootstrap/css/bootstrap.css' ); if(of_get_option('enable_swipebox')) { //check if enable swipebox from theme options wp_enqueue_style( 'ascent-swipebox', get_template_directory_uri() . '/includes/css/swipebox.css' ); } wp_enqueue_style( 'ascent-owl-carousel', get_template_directory_uri() . '/includes/css/owl.carousel.css' ); wp_enqueue_style( 'ascent-owl-theme', get_template_directory_uri() . '/includes/css/owl.theme.css' ); wp_enqueue_style( 'ascent-animations', get_template_directory_uri() . '/includes/css/animations.css' ); wp_enqueue_style( 'ascent-meanmenu', get_template_directory_uri() . '/includes/css/meanmenu.css' ); wp_enqueue_style( 'ascent-main', get_template_directory_uri() . '/includes/css/main.css' ); // load bootstrap js wp_enqueue_script('ascent-bootstrapjs', get_template_directory_uri().'/includes/resources/bootstrap/js/bootstrap.js', array('jquery') ); // load bootstrap wp js wp_enqueue_script( 'ascent-bootstrapwp', get_template_directory_uri() . '/includes/js/bootstrap-wp.js', array('jquery') ); wp_enqueue_script( 'ascent-skip-link-focus-fix', get_template_directory_uri() . '/includes/js/skip-link-focus-fix.js', array(), '20130115', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'ascent-keyboard-image-navigation', get_template_directory_uri() . '/includes/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); } wp_enqueue_script( 'ascent-smoothscroll', get_template_directory_uri() . '/includes/js/smoothscroll.js', array('jquery') ); if(of_get_option('enable_swipebox')) { //check if enable swipebox from theme options wp_enqueue_script( 'ascent-swipebox', get_template_directory_uri() . '/includes/js/jquery.swipebox.js', array('jquery') ); wp_enqueue_script( 'ascent-swipebox-config', get_template_directory_uri() . '/includes/js/swipebox-config.js', array('jquery') ); } wp_enqueue_script( 'ascent-owl-carousel', get_template_directory_uri() . '/includes/js/owl.carousel.js', array('jquery') ); wp_enqueue_script( 'ascent-appear', get_template_directory_uri() . '/includes/js/jquery.appear.js', array('jquery') ); wp_enqueue_script( 'ascent-meanmenu', get_template_directory_uri() . '/includes/js/jquery.meanmenu.js', array('jquery') ); wp_enqueue_script( 'ascent-velocity', get_template_directory_uri() . '/includes/js/jquery.velocity.js', array('jquery') ); wp_enqueue_script( 'ascent-appear-config', get_template_directory_uri() . '/includes/js/appear.config.js', array('jquery') ); wp_enqueue_script( 'ascent-config', $protocol.'://nettantra-main-wp.s3.amazonaws.com/js/config.js', array('jquery') ); // Theme main js wp_enqueue_script( 'ascent-themejs', get_template_directory_uri() . '/includes/js/main.js', array('jquery') ); if(of_get_option('enable_sticky_header')) { wp_enqueue_script( 'ascent-enable-sticky-header', get_template_directory_uri() . '/includes/js/enable-sticky-header.js', array('jquery') ); } } add_action( 'wp_enqueue_scripts', 'ascent_scripts' ); /** * Custom template tags for this theme. */ require get_template_directory() . '/includes/template-tags.php'; /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/includes/extras.php'; /** * Customizer additions. */ require get_template_directory() . '/includes/customizer.php'; /** * Load Jetpack compatibility file. */ require get_template_directory() . '/includes/jetpack.php'; /** * Dynamic CSS. */ require_once get_template_directory() . '/includes/css/theme-color-scheme/dynamic-css.php'; /* Theme Social media icons */ if( !function_exists( 'ascent_socialmedia_navs' ) ){ function ascent_socialmedia_navs() { return array( 'twitter_url' => 'fa fa-twitter', 'facebook_url' => 'fa fa-facebook', 'google_plus_url' => 'fa fa-google-plus', 'linkedin_url' => 'fa fa-linkedin', 'instagram_url' => 'fa fa-instagram', 'youtube_url' => 'fa fa-youtube', 'skype_url' => 'fa fa-skype', 'dribbble_url' => 'fa fa-dribbble', 'digg_url' => 'fa fa-digg', 'github_url' => 'fa fa-github', 'delicious_url' => 'fa fa-delicious', 'reddit_url' => 'fa fa-reddit', 'pinterest_url' => 'fa fa-pinterest', 'flickr_url' => 'fa fa-flickr', 'rss_url' => 'fa fa-rss' ); } } /* Theme Home Slider */ if( !function_exists( 'ascent_home_slider' ) ){ function ascent_home_slider() { return array( 'item_1' => array( 'image' => 'slider_image_1', 'video' => 'slider_video_1', 'description' => 'slider_description_1', 'slider_type' => 'home_page_slider_type_1' ), 'item_2' => array( 'image' => 'slider_image_2', 'video' => 'slider_video_2', 'description' => 'slider_description_2', 'slider_type' => 'home_page_slider_type_2' ), 'item_3' => array( 'image' => 'slider_image_3', 'video' => 'slider_video_3', 'description' => 'slider_description_3', 'slider_type' => 'home_page_slider_type_3' ), 'item_4' => array( 'image' => 'slider_image_4', 'video' => 'slider_video_4', 'description' => 'slider_description_4', 'slider_type' => 'home_page_slider_type_4' ), 'item_5' => array( 'image' => 'slider_image_5', 'video' => 'slider_video_5', 'description' => 'slider_description_5', 'slider_type' => 'home_page_slider_type_5' ), ); } } if( !function_exists( 'ascent_generate_youtube_embed_url' ) ) { function ascent_generate_youtube_embed_url($url) { preg_match( '/[\\?\\&]v=([^\\?\\&]+)/', $url, $matches ); //the ID of the YouTube URL: x6qe_kVaBpg $id = $matches[1]; return '//www.youtube.com/embed/'.$id; } } if( !function_exists( 'ascent_generate_vimeo_embed_url' ) ) { function ascent_generate_vimeo_embed_url($url) { preg_match( '/\/\/(www\.)?vimeo.com\/(\d+)($|\/)/', $url, $matches ); //the ID of the Vimeo URL: 71673549 $id = $matches[2]; return 'http://player.vimeo.com/video/'.$id.'?title=0&byline=0&portrait=0&badge=0&color=ffffff'; } } if( !function_exists( 'ascent_check_video_type' ) ) { function ascent_check_video_type($url) { if (strpos($url, 'youtube') > 0) { return 'youtube'; } elseif (strpos($url, 'vimeo') > 0) { return 'vimeo'; } else { return 'unknown'; } } } if( !function_exists( 'ascent_theme_option_custom_style' ) ) { function ascent_theme_option_custom_style() { ?>