tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); add_image_size('corporate-stars-lite-hteam-img',255,255,true); add_image_size('corporate-stars-lite-index-img',349,186,true); add_image_size('corporate-stars-lite-clients-img',179,63,true); add_image_size('corporate-stars-lite-products-img',240,141,true); add_image_size('corporate-stars-lite-portfolio-img',338,190,true); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'main-menu' => esc_html__( 'Primary', 'corporate-stars-lite' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); /* * custom logo */ add_theme_support( 'custom-logo', array( 'height' => 42, 'width' => 184, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'corporate_stars_lite_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); } endif; add_action( 'after_setup_theme', 'corporate_stars_lite_setup' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function corporate_stars_lite_content_width() { $GLOBALS['content_width'] = apply_filters( 'corporate_stars_lite_content_width', 640 ); } add_action( 'after_setup_theme', 'corporate_stars_lite_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function corporate_stars_lite_widgets_init() { register_sidebar( array( 'name' => esc_html__('Sidebar ', 'corporate-stars-lite' ), 'id' => 'corporate-stars-lite-sidebar1', ) ); register_sidebar( array( 'name' => esc_html__( 'Home Page Widget', 'corporate-stars-lite' ), 'id' => 'corporate-stars-lite-slider', ) ); register_sidebar( array( 'name' => esc_html__('Footer Widget 1 ', 'corporate-stars-lite' ), 'before_title' => '
', 'id' => 'corporate-stars-lite-footer-widget1', ) ); register_sidebar( array( 'name' => esc_html__('Footer Widget 2 ', 'corporate-stars-lite' ), 'before_title' => ' ', 'id' => 'corporate-stars-lite-footer-widget2', ) ); register_sidebar( array( 'name' => esc_html__('Footer Widget 3 ', 'corporate-stars-lite' ), 'before_title' => ' ', 'id' => 'corporate-stars-lite-footer-widget3', ) ); register_sidebar( array( 'name' => esc_html__('Footer Widget 4 ', 'corporate-stars-lite' ), 'before_title' => ' ', 'id' => 'corporate-stars-lite-footer-widget4', ) ); } add_action( 'widgets_init', 'corporate_stars_lite_widgets_init' ); /** * Enqueue scripts and styles. */ function corporate_stars_lite_scripts() { wp_enqueue_style('bootstrap-min', get_template_directory_uri().'/css/bootstrap.min.css', array(),'3.3.6','all'); wp_enqueue_style('corporate-stars-lite-smartmenus', get_template_directory_uri().'/css/jquery.smartmenus.bootstrap.css', array(),'1.0.0','all'); wp_enqueue_style('font-awesome-min', get_template_directory_uri().'/css/font-awesome.min.css',array(),'4.6.3','screen'); wp_enqueue_style('corporate-stars-lite-carousel', get_template_directory_uri().'/css/owl.carousel.css',array(),'1.3.3','all'); wp_enqueue_style('corporate-stars-lite-theme', get_template_directory_uri().'/css/owl.theme.css',array(),'1.3.3','all'); wp_enqueue_style('corporate-stars-lite-corporate', get_template_directory_uri().'/css/corporate.css',array(),null,'all'); wp_enqueue_style('corporate-stars-lite-corporate-style', get_template_directory_uri().'/css/style.css',array(),null,'all'); wp_enqueue_style( 'corporate-stars-lite-style', get_stylesheet_uri() ,array(),null,'all'); wp_enqueue_style('corporate-stars-lite-corporate-media', get_template_directory_uri().'/css/media.css',array(),null,'all'); if ( ! is_admin() ) { wp_enqueue_script( 'jquery' ); } wp_enqueue_script( 'bootstrap', get_template_directory_uri().'/js/bootstrap.min.js', array('jquery'),'3.3.7',true); wp_enqueue_script( 'smartmenus', get_template_directory_uri().'/js/jquery.smartmenus.js', array('jquery'),'1.0.0',true); wp_enqueue_script( 'smartmenus-bootstrap', get_template_directory_uri().'/js/jquery.smartmenus.bootstrap.js',array('jquery'),'0.3.0',true); wp_enqueue_script( 'owl-carousel', get_template_directory_uri().'/js/owl.carousel.js',array('jquery'),'1.3.3',true); wp_enqueue_script( 'responsiveslides', get_template_directory_uri().'/js/responsiveslides.min.js',array('jquery'),'1.54',true); wp_enqueue_script( 'isotope-min', get_template_directory_uri().'/js/jquery.isotope.js',array('jquery'),'1.5.25',true); wp_enqueue_script( 'corporate-stars-lite-portfolio', get_template_directory_uri().'/js/portfolio.js',array('jquery'),null,true); wp_enqueue_script( 'corporate-stars-lite-smartmenus-corporate', get_template_directory_uri() . '/js/corporate.js',array('jquery'),null,true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'corporate_stars_lite_scripts' ); /** * Implement the Custom Header feature. */ require get_template_directory() . '/inc/custom-header.php'; require get_template_directory() . '/inc/widgets/home-abtus-widget-setting.php'; require get_template_directory() . '/inc/widgets/home-team-widget-setting.php'; require get_template_directory() . '/inc/widgets/slider-widget-setting.php'; require get_template_directory() . '/inc/widgets/home-portfolio-widget-setting.php'; require get_template_directory() . '/inc/widgets/home-blog-widget-setting.php'; require get_template_directory() . '/inc/widgets/home-service-widget-setting.php'; require get_template_directory() . '/inc/widgets/home-product-widget-setting.php'; require get_template_directory() . '/inc/widgets/home-testimonials-widget-setting.php'; require get_template_directory() . '/inc/widgets/home-clients-widget-setting.php'; require get_template_directory() . '/inc/widgets/cta-widget-setting.php'; // enqueue google fonts function corporate_stars_lite_enqueue_google_fonts(){ $query_args = array( 'family' => 'Bad+Script', ); wp_register_style( 'bad-script', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null ); wp_enqueue_style( 'bad-script' ); $query_args1 = array( 'family' => 'Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800', ); wp_register_style( 'open-sans', add_query_arg( $query_args1, "//fonts.googleapis.com/css" ), array(), null ); wp_enqueue_style( 'open-sans' ); $fontName= esc_attr(get_theme_mod('corporate_stars_lite_fontFamilyName','Open Sans')); $famlilyName = preg_replace('/\s+/', '+', $fontName); $query_args2 = array( 'family' => $famlilyName, ); wp_register_style('corporate-stars-lite-google-fonts', add_query_arg( $query_args2, "//fonts.googleapis.com/css" ), array(), null ); wp_enqueue_style( 'corporate-stars-lite-google-fonts' ); } add_action('wp_enqueue_scripts', 'corporate_stars_lite_enqueue_google_fonts'); // customizer css function corporate_stars_lite_customizer_css(){ wp_register_style( 'corporate-stars-lite-customizer', get_template_directory_uri() . '/css/corporate_stars_lite_customizer.css', false, '1.0.0' ); wp_enqueue_style('corporate-stars-lite-customizer'); } add_action('admin_enqueue_scripts','corporate_stars_lite_customizer_css'); // enqueue widgets scripts function corporate_stars_lite_custom_widget_js_scrips(){ wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'wp-color-picker' ); } add_action('init','corporate_stars_lite_custom_widget_js_scrips'); // enqueue editor-style.css file function corporate_stars_lite_add_editor_style(){ add_editor_style('editor-style.css'); } add_action( 'admin_init', 'corporate_stars_lite_add_editor_style' ); /** * Customizer additions. */ require get_template_directory() .'/inc/customizer.php'; /** * documentation and demo setting */ require get_template_directory().'/inc/docDemo.php'; // CUSTOMIZING COMMMENT function corporate_stars_lite_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; if ( $args['avatar_size'] != 0 ) echo ' '; ?> /'; // delimiter between crumbs $home = 'Home'; // text for the 'Home' link $showCurrent = 1; // 1 - show current post/page title in breadcrumbs, 0 - don't show global $post; $homeLink = esc_url(home_url()); if (is_home() || is_front_page()) { if ($showOnHome == 1) echo ''; } else { if(is_archive()): echo ''.__("Archive Page",'corporate-stars-lite').'
'. esc_html($home) . ''; elseif(is_search()): echo '
'.__("Search Page",'corporate-stars-lite').'
'. esc_html($home) . ''; else: echo '
'.esc_html(get_the_title()).'
'.esc_html($home) . ''; endif; if ( is_category() ) { $thisCat = get_category(get_query_var('cat'), false); if ($thisCat->parent != 0) echo esc_html(get_category_parents($thisCat->parent, TRUE)); _e('Archive by category','corporate-stars-lite');echo '"'.esc_html(single_cat_title('', false)) . '"'; } elseif ( is_search() ) { _e('Search results for ','corporate-stars-lite'); echo '"'. esc_html(get_search_query()) . '"'; } elseif ( is_day() ) { echo '' . esc_attr(get_the_time('Y')) . ' '; echo '' . esc_attr(get_the_time('F')) . ' '; echo esc_attr(get_the_time('d')); } elseif ( is_month() ) { echo '' . esc_attr(get_the_time('Y')) . ' '; echo esc_attr(get_the_time('F')); } elseif ( is_year() ) { echo esc_attr(get_the_time('Y')); } elseif ( is_single() && !is_attachment() ) { if ( get_post_type() != 'post' ) { $post_type = get_post_type_object(get_post_type()); $slug = $post_type->rewrite; echo '' . esc_attr($post_type->labels->singular_name) . ''; if ($showCurrent == 1) echo esc_attr(get_the_title()) . '
'; } else { $cat = get_the_category(); $cat = $cat[0]; $cats = get_category_parents($cat, TRUE); if ($showCurrent == 0) $cats = preg_replace("#^(.+)s s$#", "$1", $cats); echo untrailingslashit($cats); if ($showCurrent == 1) echo esc_attr(get_the_title()) . ''; } } elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) { $post_type = get_post_type_object(get_post_type()); echo esc_attr($post_type->labels->singular_name) .''; } elseif ( is_attachment() ) { $parent = get_post($post->post_parent); $cat = get_the_category($parent->ID); $cat = $cat[0]; echo esc_attr(get_category_parents($cat, TRUE)); echo '' . esc_attr($parent->post_title) . ''; if ($showCurrent == 1) echo esc_attr(get_the_title()) . ''; } elseif ( is_page() && !$post->post_parent ) { if ($showCurrent == 1) echo esc_html(get_the_title()) . ''; } elseif ( is_page() && $post->post_parent ) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = '' . esc_html(get_the_title($page->ID)) . ''; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); for ($i = 0; $i < count($breadcrumbs); $i++) { echo $breadcrumbs[$i]; if ($i != count($breadcrumbs)-1) ; } if ($showCurrent == 1) echo esc_html(get_the_title()) .''; } elseif ( is_tag() ) { _e('Posts tagged','corporate-stars-lite'); echo '"'. esc_html(single_tag_title('', false)) . '"' .''; } elseif ( is_author() ) { global $author; $userdata = get_userdata($author); _e('Articles posted by ','corporate-stars-lite'); echo esc_html($userdata->display_name) .''; } elseif ( is_day() ) { // Year link echo '