__( 'Primary Menu', 'appworx' ) ) ); // Content width global $content_width; if ( ! isset( $content_width ) ) { $content_width = 1170; } /* * Enable support for Post Formats. * See http://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', ) ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'appworx_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', ) ); // Add theme support for Custom Logo. add_theme_support( 'custom-logo', array( 'width' => 250, 'height' => 250, 'flex-width' => true, ) ); } endif; add_action( 'after_setup_theme', 'appworx_setup' ); /** * Theme preloader */ function appworx_preloader() { ?> <div class="preloader"> <div class="spinner"> <div class="pre-bounce1"></div> <div class="pre-bounce2"></div> </div> </div> <?php } add_action('appworx_before_site', 'appworx_preloader'); /** * Blog layout */ function appworx_blog_layout() { $layout = get_theme_mod('blog_layout','classic-alt'); return $layout; } /** * Prints HTML with meta information for the current post-date/time and author. */ if ( ! function_exists( 'appworx_posted_on' ) ) : function appworx_posted_on() { $layout = appworx_blog_layout(); $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); $posted_on = sprintf( _x( '%s', 'post date', 'appworx' ), '<i class="fa fa-calendar"></i><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' ); $byline = sprintf( _x( '%s', 'post author', 'appworx' ), '<i class="fa fa-user"></i><span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' ); $tags = get_the_tags(); $singletag = ''; $tagsline = ''; if( $tags) : foreach( $tags as $tag ){ $singletag .= '<a href="' . esc_url( get_tag_link( $tag->term_id ) ) . '">'. esc_html( $tag->name ) .'</a>'; } $tagsline = '<span class="tags"><i class="fa fa-tag"></i><span class="blog-category-url">'.$singletag .'</span></span>'; endif; $category = get_the_category(); $singlecategory = ''; $categoryline = ''; $comments = ''; if($category) : foreach( $category as $cat ){ $singlecategory .= '<a href="' . esc_url( get_tag_link( $cat->term_id ) ) . '">'. esc_html( $cat->name ) .'</a>'; } $categoryline = '<span class="blog-category"><i class="fa fa-list"></i><span class="blog-category-url">' . $singlecategory . '</span></span>'; endif; if($layout == 'classic-alt'){ $comments = '<i class="fa fa-commenting"></i><span class="comment-count"><a href="' . esc_url( get_permalink() ) . '">' . esc_html(get_comments_number()) . ' comments</a></span>'; } echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>' . $comments . $categoryline . $tagsline; } endif; if ( ! function_exists( 'appworx_grid_post_meta' ) ) : function appworx_grid_post_meta(){ $time_string = '<time class="entry-date published updated" datetime="%1$s"><span class="date-d">%2$s</span><span class="date-my">%3$s</span></time>'; $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date('j') ), esc_html( get_the_date('M, y') ) ); $posted_on = sprintf( _x( '%s', 'post date', 'appworx' ), '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' ); $byline = sprintf( _x( '%s', 'post author', 'appworx' ), '<i class="fa fa-user"></i><span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' ); $comments = '<i class="fa fa-commenting"></i><span class="comment-count"><a href="' . esc_url( get_permalink() ) . '">' . esc_html(get_comments_number()) . ' comments</a></span>'; echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'. '<span class="comments">' . $comments . '</span>'; } endif; // Changing excerpt more function appworx_excerpt_more($more) { global $post; $layout = appworx_blog_layout(); return ' ....  <a class=" '.$layout.'" href="'. get_permalink($post->ID) . '">' . __('Read More', 'appworx') . '</a>'; } add_filter('excerpt_more', 'appworx_excerpt_more'); /** * Enqueue scripts and styles. */ function appworx_scripts() { wp_enqueue_style( 'owl.carousel', get_template_directory_uri() . '/css/owl.carousel.css' ); wp_enqueue_style( 'owl.theme', get_template_directory_uri() . '/css/owl.theme.css' ); wp_enqueue_style( 'appworx-fonts', esc_url( appworx_google_fonts() ), array(), null ); wp_enqueue_style( 'appworx-style', get_stylesheet_uri() ); wp_enqueue_style( 'style', get_template_directory_uri() . '/css/style.css' ); wp_enqueue_script( 'appworx-main', get_template_directory_uri() . '/js/main.js', array('jquery'), '20180213', true ); wp_enqueue_script( 'owl.carousel.min', get_template_directory_uri() . '/js/owl.carousel.min.js', array('jquery'), '20180213', true ); wp_enqueue_script( 'wow.min', get_template_directory_uri() . '/js/wow/wow.min.js', array('jquery'), '20180213', true ); wp_enqueue_style( 'appworx-font-awesome', get_template_directory_uri() . '/fonts/font-awesome.min.css' ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'appworx_scripts' ); /** * Fonts */ if ( !function_exists('appworx_google_fonts') ) : function appworx_google_fonts() { $body_font = get_theme_mod('body_font_name', 'Poppins:400,600'); $headings_font = get_theme_mod('headings_font_name', 'Ubuntu:400,400i,500,500i'); $fonts = array(); $fonts[] = esc_attr( str_replace( '+', ' ', $body_font ) ); $fonts[] = esc_attr( str_replace( '+', ' ', $headings_font ) ); if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ) ), 'https://fonts.googleapis.com/css' ); } return $fonts_url; } endif; function appworx_header_background() { $title = get_theme_mod('header_title_1', __('Welcome to Appworx', 'appworx')); $fornt_img = get_theme_mod('background_image_right',get_stylesheet_directory_uri() . '/images/banner-img-01.png'); $subtitle = get_theme_mod('header_subtitle_1', __('Delivers more than expected', 'appworx')); $subpera = get_theme_mod('header_subpera_1', __('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi imperdiet ullamcorper erat', 'appworx')); $button_icon = get_theme_mod('o2_fa_icon_picker', ''); $button_text1 = get_theme_mod('banner_button1', __('Ready to start', 'appworx')); $button_text2 = get_theme_mod('banner_button2', __('Ready to start', 'appworx')); $button_url1 = get_theme_mod('banner_button_url1', '#'); $button_url2 = get_theme_mod('banner_button_url2', '#'); $front_header_type = get_theme_mod('front_header_type', 'image'); $site_header_type = get_theme_mod('site_header_type', 'image'); if ( $front_header_type == 'image' && is_front_page() ) : ?> <div class="header-background"> <div class="header-content"> <div class="container"> <div class="row align-center"> <div class="<?php if(!empty($fornt_img)){ echo 'col-md-7 col-lg-8' ;} else {echo 'col-md-12 col-lg-12';} ?> "> <div class="banner-text-content" > <h5 class="bg-maintitle"><?php echo esc_html( $title ); ?></h5> <h1 class="bg-subtitle"><?php echo esc_html( $subtitle ); ?></h1> <p class="bg-subpera"><?php echo esc_html( $subpera ); ?></p> <?php if(!empty($button_text1)){ ?> <div class="banner-btn-div"> <a href="<?php echo esc_url( $button_url1 ); ?>" class="bg-banner-button banner-button mt-5"><?php echo esc_html( $button_text1 ); ?></a>   <?php }?> <?php if(!empty($button_text2)){ ?> <a href="<?php echo esc_url( $button_url2 ); ?>" class="bg-banner-button2 banner-button mt-5"><?php echo esc_html( $button_text2 ); ?></a> </div> <?php }?> </div> </div> <?php if(!empty($fornt_img)){ ?> <div class="col-md-5 col-lg-3 "> <div class="background_image_right"> <img class="front_img" src="<?php echo esc_url($fornt_img); ?>" alt="Banner Image"> </div> </div> <?php }?> </div> </div> </div> </div> <?php endif; } /** * Header video */ function appworx_header_video() { if ( !function_exists('the_custom_header_markup') ) { return; } $front_header_type = get_theme_mod( 'front_header_type' ); $site_header_type = get_theme_mod( 'site_header_type' ); if ( ( get_theme_mod('front_header_type') == 'core-video' && is_front_page() || get_theme_mod('site_header_type') == 'core-video' && !is_front_page() ) ) { the_custom_header_markup(); } } /** * Register widget area. * * @link http://codex.wordpress.org/Function_Reference/register_sidebar */ function appworx_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'appworx' ), 'id' => 'sidebar-1', 'description' => '', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); //Footer widget areas $widget_areas = get_theme_mod('footer_widget_areas', '3'); for ($i=1; $i<=$widget_areas; $i++) { register_sidebar( array( 'name' => __( 'Footer ', 'appworx' ) . $i, 'id' => 'footer-' . $i, 'description' => '', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } } add_action( 'widgets_init', 'appworx_widgets_init' ); /** * Enqueue Bootstrap */ function appworx_enqueue_bootstrap() { wp_enqueue_style( 'appworx-bootstrap', get_template_directory_uri() . '/css/bootstrap/bootstrap.min.css', array(), true ); } add_action( 'wp_enqueue_scripts', 'appworx_enqueue_bootstrap', 9 ); /** * Custom-Header */ require get_template_directory() . '/inc/custom-header.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Styles */ require get_template_directory() . '/inc/styles.php'; /** * Recommended plugins */ require get_template_directory() . '/recommend/class-tgm-plugin-activation.php'; /** * Upsell */ require get_template_directory() . '/upsell/class-customize.php'; /** * Demo content */ require_once dirname( __FILE__ ) . '/demo-content/demo-content-setup.php'; function appworx_recommend_plugin() { $plugins[] = array( 'name' => 'Elementor', 'slug' => 'elementor', 'required' => false, ); $plugins[] = array( 'name' => 'Contact Form 7', 'slug' => 'contact-form-7', 'required' => false, ); $plugins[] = array( 'name' => 'Bizworx Tools', 'slug' => 'bizworx-tools', 'required' => false, ); tgmpa( $plugins); } add_action( 'tgmpa_register', 'appworx_recommend_plugin' ); if ( ! function_exists( 'appworx_edit_link' ) ) : /** * Returns an accessibility-friendly link to edit a post or page. * * This also gives us a little context about what exactly we're editing * (post or page?) so that users understand a bit more where they are in terms * of the template hierarchy and their content. Helpful when/if the single-page * layout with multiple posts/pages shown gets confusing. */ function appworx_edit_link() { edit_post_link( sprintf( /* translators: %s: Name of current post */ __( '<i class="fa fa-edit"></i>Edit<span class="screen-reader-text"> "%s"</span>', 'appworx' ), get_the_title() ), '<span class="edit-link">', '</span>' ); } endif; /** * Generate breadcrumbs */ function get_breadcrumb() { echo '<a href="'.home_url().'" rel="nofollow">'.__('Home', 'appworx').'</a>'; if (is_category() || is_single()) { echo "  /  "; the_category(' • '); if (is_single()) { echo "   /   "; the_title(); } } elseif (is_page()) { echo "  /  "; echo the_title(); } elseif (is_search()) { echo __("  /  Search Results for... ", "appworx"); echo '"<em>'; echo the_search_query(); echo '</em>"'; } } function tn_custom_excerpt_length( $length ) { $exce_len = get_theme_mod('exc_lenght', 25); return $exce_len; } add_filter( 'excerpt_length', 'tn_custom_excerpt_length', 999 );