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. * * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support( 'custom-header' ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 825, 530, true ); add_image_size('services-detail', 1200, 650, true); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( 'primary' => esc_html__( 'Primary Menu', 'taskereasy' ), ) ); /* * 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' ) ); /* * Enable support for Post Formats. * * See: https://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat' ) ); /* * Enable support for custom logo. * * @since taskereasy 1.5 */ add_theme_support( 'custom-logo', array( 'height' => 50, 'width' => 200, 'flex-height' => true, ) ); } endif; add_action( 'after_setup_theme', 'taskereasy_setup' ); /** * Load Theme Google fonts */ if( !function_exists('taskereasy_load_google_fonts') ){ function taskereasy_load_google_fonts(){ $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Lora, translate this to 'off'. Do not translate * into your own language. */ $montserrat = _x( 'on', 'Montserrat font: on or off', 'taskereasy' ); $open_sans = _x( 'on', 'Open Sans font: on or off', 'taskereasy' ); if ( 'off' !== $montserrat || 'off' !== $open_sans ) { $font_families = array(); if ( 'off' !== $montserrat ) { $font_families[] = 'Montserrat:300,400,500,600,700,800'; } if ( 'off' !== $open_sans ) { $font_families[] = 'Open+Sans:400,600,700'; } $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return $fonts_url; } } /** * Load front-end styles and scripts */ if( !function_exists( 'taskereasy_scripts' ) ){ function taskereasy_scripts(){ wp_enqueue_style( 'bootstrap', get_theme_file_uri( '/assets/css/bootstrap.min.css'), array() ); wp_enqueue_style( 'font-awesome', get_theme_file_uri( '/assets/css/font-awesome.min.css'), array() ); wp_enqueue_style( 'taskereasy-custom-stylesheet', get_theme_file_uri( '/assets/css/style.css'), array() ); wp_enqueue_style( 'taskereasy-style', get_theme_file_uri( '/style.css'), array() ); wp_enqueue_style( 'owl-stylesheet', get_theme_file_uri( '/assets/css/owl.carousel.css'), array() ); wp_enqueue_style( 'slick-stylesheet', get_theme_file_uri( '/assets/css/slick.css'), array() ); wp_enqueue_style( 'magnific-popup-stylesheet', get_theme_file_uri( '/assets/css/magnific-popup.css'), array() ); //Load google fonts wp_enqueue_style( 'google-fonts', taskereasy_load_google_fonts(), array(), null ); /***** Scripts ******/ wp_enqueue_script( 'bootstrap', get_theme_file_uri( '/assets/js/bootstrap.min.js'), array('jquery'), false, true ); wp_enqueue_script( 'jquery-magnific-popup', get_theme_file_uri( '/assets/js/jquery.magnific-popup.min.js'), array('jquery'), false, true ); wp_enqueue_script( 'owl-carousel', get_theme_file_uri( '/assets/js/owl.carousel.min.js'), array('jquery'), false, true ); wp_enqueue_script( 'slick-slider', get_theme_file_uri( '/assets/js/slick.min.js'), array('jquery'), false, true ); wp_enqueue_script( 'taskereasy-javascript', get_theme_file_uri( '/assets/js/interface.js'), array('jquery'), false, true ); wp_enqueue_script( 'isotope', get_theme_file_uri( '/assets/js/isotope.pkgd.min.js'), array('jquery'), false, true ); wp_enqueue_script( 'jquery-instagramFeed', get_theme_file_uri( '/assets/js/jquery.instagramFeed.min.js'), array('jquery'), false, true ); $custom_dynamic_style = taskereasy_custom_dynamic_style(); if( ! empty( $custom_dynamic_style ) ){ wp_add_inline_style( 'taskereasy-style', $custom_dynamic_style ); } if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'taskereasy_scripts' ); } if( ! function_exists( 'taskereasy_admin_script' ) ){ function taskereasy_admin_script(){ wp_enqueue_style( '', get_theme_file_uri( '/assets/css/admin/style.css' ) ); } add_action( 'admin_enqueue_scripts', 'taskereasy_admin_script' ); } // Set the theme's favicon if( ! function_exists( 'taskereasy_favicon' ) ){ function taskereasy_favicon() { if ( function_exists( 'has_site_icon' ) && has_site_icon() ) { if( !empty( get_site_icon_url() ) ){ echo ''; } } } } // Theme Setup Wizard require_once get_parent_theme_file_path( '/setup/envato_setup.php' ); function taskereasy_primary_menu(){ $defaults = array( 'menu_class' => 'nav navbar-nav', 'menu_id' => '', 'container' => '', 'fallback_cb' => '', 'container_class' => 'collapse navbar-collapse', ); if( has_nav_menu( 'primary' ) ){ $defaults = array( 'theme_location'=> 'primary', 'menu_class' => 'nav navbar-nav', 'menu_id' => '', 'container' => '', 'fallback_cb' => '', ); } return wp_nav_menu( $defaults ); } function taskereasy_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Blog Sidebar', 'taskereasy' ), 'id' => 'sidebar-7', 'description' => esc_html__( 'Add widgets here to appear in your blog.', 'taskereasy' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 1', 'taskereasy' ), 'id' => 'sidebar-3', 'description' => esc_html__( 'Add widgets here to appear in your header.', 'taskereasy' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 2', 'taskereasy' ), 'id' => 'sidebar-4', 'description' => esc_html__( 'Add widgets here to appear in your header.', 'taskereasy' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 3', 'taskereasy' ), 'id' => 'sidebar-5', 'description' => esc_html__( 'Add widgets here to appear in your header.', 'taskereasy' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 4', 'taskereasy' ), 'id' => 'sidebar-6', 'description' => esc_html__( 'Add widgets here to appear in your header.', 'taskereasy' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => esc_html__( 'Bottom Footer', 'taskereasy' ), 'id' => 'sidebar-9', 'description' => esc_html__( 'Add widgets here to appear in bottom footer.', 'taskereasy' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => esc_html__( 'Free Widget Area', 'taskereasy' ), 'id' => 'free-sidebar', 'description' => esc_html__( 'Add widgets here to use in WPBakery', 'taskereasy' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); } add_action( 'widgets_init', 'taskereasy_widgets_init' ); /*****************************blog banner******************************/ function taskereasy_blog_banner(){ echo '

'.wp_title('', false).'

'.taskereasy_breadcrumbs().'
'; } /** * Register the Welcome page after theme activation. * * @since 2.1.1 */ function taskereasy_register_welcome_page(){ add_theme_page( 'Taskereasy', 'Taskereasy', 'edit_theme_options', 'taskereasy', 'taskereasy_welcome_page_content' ); } add_action( 'admin_menu', 'taskereasy_register_welcome_page' ); /** * Welcome Page content. * * @since 2.1.1 */ function taskereasy_welcome_page_content(){ get_template_part('template-parts/admin/welcome'); } /* Redirect to wizard on theme activation */ if (is_admin() && isset($_GET['activated']) && $pagenow == "themes.php") wp_redirect('themes.php?page=taskereasy'); /** * Add a pingback url auto-discovery header for single posts, pages, or attachments. */ function taskereasy_pingback_header() { if ( is_singular() && pings_open() ) { echo ''; } } add_action( 'wp_head', 'taskereasy_pingback_header' ); /***********************end of blog banner******************************/ function taskereasy_breadcrumbs(){ // Set variables for later use $home_link = esc_url(home_url('/')); $home_text = esc_html__( 'Home', 'taskereasy' ); $link_before = ''; $link_attr = ''; $link = $link_before . '%2$s' . $link_after; $delimiter = ''; // Delimiter between crumbs $before = ''; // Tag after the current crumb $page_addon = ''; // Adds the page number if the query is paged $breadcrumb_trail = ''; $category_links = ''; /** * Set our own $wp_the_query variable. Do not use the global variable version due to * reliability */ $wp_the_query = $GLOBALS['wp_the_query']; $queried_object = $wp_the_query->get_queried_object(); // Handle single post requests which includes single pages, posts and attatchments if ( is_singular() ) { /** * Set our own $post variable. Do not use the global variable version due to * reliability. We will set $post_object variable to $GLOBALS['wp_the_query'] */ $post_object = sanitize_post( $queried_object ); // Set variables $title = apply_filters( 'the_title', $post_object->post_title, $post_object->ID ); $parent = $post_object->post_parent; $post_type = $post_object->post_type; $post_id = $post_object->ID; $post_link = $before . $title . $after; $parent_string = ''; $post_type_link = ''; if ( 'post' === $post_type ) { // Get the post categories $categories = get_the_category( $post_id ); if ( $categories ) { // Lets grab the first category $category = $categories[0]; $category_links = get_category_parents( $category, true, $delimiter ); $category_links = str_replace( '', '' . $link_after, $category_links ); } } if ( !in_array( $post_type, ['post', 'page', 'attachment'] ) ) { $post_type_object = get_post_type_object( $post_type ); $archive_link = esc_url( get_post_type_archive_link( $post_type ) ); $post_type_link = sprintf( $link, $archive_link, $post_type_object->labels->singular_name ); } // Get post parents if $parent !== 0 if ( 0 !== $parent ) { $parent_links = []; while ( $parent ) { $post_parent = get_post( $parent ); $parent_links[] = sprintf( $link, esc_url( get_permalink( $post_parent->ID ) ), get_the_title( $post_parent->ID ) ); $parent = $post_parent->post_parent; } $parent_links = array_reverse( $parent_links ); $parent_string = implode( $delimiter, $parent_links ); } // Lets build the breadcrumb trail if ( $parent_string ) { $breadcrumb_trail = $parent_string . $delimiter . $post_link; } else { $breadcrumb_trail = $post_link; } if ( $post_type_link ) $breadcrumb_trail = $post_type_link . $delimiter . $breadcrumb_trail; if ( $category_links ) $breadcrumb_trail = $category_links . $breadcrumb_trail; } // Handle archives which includes category-, tag-, taxonomy-, date-, custom post type archives and author archives if( is_archive() ) { if ( is_category() || is_tag() || is_tax() ) { // Set the variables for this section $term_object = get_term( $queried_object ); $taxonomy = $term_object->taxonomy; $term_id = $term_object->term_id; $term_name = $term_object->name; $term_parent = $term_object->parent; $taxonomy_object = get_taxonomy( $taxonomy ); $current_term_link = $before . $taxonomy_object->labels->singular_name . ': ' . $term_name . $after; $parent_term_string = ''; if ( 0 !== $term_parent ) { // Get all the current term ancestors $parent_term_links = []; while ( $term_parent ) { $term = get_term( $term_parent, $taxonomy ); $parent_term_links[] = sprintf( $link, esc_url( get_term_link( $term ) ), $term->name ); $term_parent = $term->parent; } $parent_term_links = array_reverse( $parent_term_links ); $parent_term_string = implode( $delimiter, $parent_term_links ); } if ( $parent_term_string ) { $breadcrumb_trail = $parent_term_string . $delimiter . $current_term_link; } else { $breadcrumb_trail = $current_term_link; } } elseif ( is_author() ) { $breadcrumb_trail = $before . esc_html__( 'Author archive for', 'taskereasy') . $before . $queried_object->data->display_name . $after; } elseif ( is_date() ) { // Set default variables $year = $wp_the_query->query_vars['year']; $monthnum = $wp_the_query->query_vars['monthnum']; $day = $wp_the_query->query_vars['day']; // Get the month name if $monthnum has a value if ( $monthnum ) { $date_time = DateTime::createFromFormat( '!m', $monthnum ); $month_name = $date_time->format( 'F' ); } if ( is_year() ) { $breadcrumb_trail = $before . $year . $after; } elseif( is_month() ) { $year_link = sprintf( $link, esc_url( get_year_link( $year ) ), $year ); $breadcrumb_trail = $year_link . $delimiter . $before . $month_name . $after; } elseif( is_day() ) { $year_link = sprintf( $link, esc_url( get_year_link( $year ) ), $year ); $month_link = sprintf( $link, esc_url( get_month_link( $year, $monthnum ) ), $month_name ); $breadcrumb_trail = $year_link . $delimiter . $month_link . $delimiter . $before . $day . $after; } } elseif ( is_post_type_archive() ) { $post_type = $wp_the_query->query_vars['post_type']; $post_type_object = get_post_type_object( $post_type ); $breadcrumb_trail = $before . $post_type_object->labels->singular_name . $after; } } // Handle the search page if ( is_search() ) { $breadcrumb_trail = $before . esc_html__( ' Search query for: ', 'taskereasy' ) . get_search_query() . $after; } // Handle 404's if ( is_404() ) { $breadcrumb_trail = $before . esc_html__( ' Error 404', 'taskereasy' ) . $after; } // Handle paged pages if ( is_paged() ) { $current_page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : get_query_var( 'page' ); $page_addon = $before . sprintf( esc_html__( ' ( Page %s )', 'taskereasy' ), number_format_i18n( $current_page ) ) . $after; } $breadcrumb_output_link = ''; $breadcrumb_output_link .= ''; return $breadcrumb_output_link; } /* Comment Form */ if( ! function_exists( 'taskereasy_comment_form' ) ){ function taskereasy_comment_form( $comment, $args, $depth ){ $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); ?>
  • $depth, 'max_depth' => $args['max_depth'], 'reply_text'=>'' . esc_html__( 'Reply', 'taskereasy' ) ) ) ); ?>
  • esc_html__( '«', 'taskereasy' ), 'next_text' => esc_html__( '»', 'taskereasy' ), 'mid_size' => 2, 'screen_reader_text' => ' ', ) ); } } //Exclude pages from WordPress Search if (!is_admin()) { function taskereasy_search_filter($query) { if ($query->is_search) { $query->set('post_type', 'post'); } return $query; } add_filter('pre_get_posts','taskereasy_search_filter'); } // Define excerpt length if( ! function_exists( 'taskereasy_custom_excerpt_length' ) ){ function taskereasy_custom_excerpt_length( $limit ){ $excerpt = explode(' ', get_the_excerpt(), $limit); if (count($excerpt)>=$limit) { array_pop($excerpt); $excerpt = implode(" ",$excerpt).''; } else { $excerpt = implode(" ",$excerpt); } $excerpt = preg_replace('`[[^]]*]`','',$excerpt); return $excerpt; } } // For recommended plugin require get_parent_theme_file_path( '/inc/class-tgm-plugin-activation.php'); // Require Custom style require get_template_directory(). '/inc/dynamic-style.php'; /** * Require Plugin */ function taskereasy_register_required_plugins() { $plugins = array( array( 'name' => esc_html__('Redux Framework','taskereasy'), 'slug' => 'redux-framework', 'required' => true, ), array( 'name' => esc_html__('Contact Form 7','taskereasy'), 'slug' => 'contact-form-7', 'required' => false, ), array( 'name' => esc_html__('Newsletter','taskereasy'), 'slug' => 'newsletter', 'required' => false, ), array( 'name' => esc_html__('WPBakery Visual Composer','taskereasy'), 'slug' => 'js_composer', 'source' => esc_url('https://slidesigma.com/themes/wp/taskereasy/plugins/js_composer.zip'), 'required' => true, 'external_url' => esc_url('https://slidesigma.com/themes/wp/taskereasy/plugins/js_composer.zip'), ), array( 'name' => esc_html__('Slider Revolution','taskereasy'), 'slug' => 'revslider', 'source' => esc_url('https://slidesigma.com/themes/wp/taskereasy/plugins/revslider.zip'), 'required' => true, 'external_url' => esc_url('https://slidesigma.com/themes/wp/taskereasy/plugins/revslider.zip'), ), array( 'name' => esc_html__('Taskereasy Plugin','taskereasy'), 'slug' => 'taskereasy-plugin', 'source' => esc_url('https://slidesigma.com/themes/wp/taskereasy/plugins/taskereasy-plugin.zip'), 'required' => true, 'external_url' => esc_url('https://slidesigma.com/themes/wp/taskereasy/plugins/taskereasy-plugin.zip'), ), ); /** * Array of configuration settings. Amend each line as needed. * If you want the default strings to be available under your own theme domain, * leave the strings uncommented. * Some of the strings are added into a sprintf, so see the comments at the * end of each line for what each argument will be. */ $config = array( 'id' => 'taskereasy', // Text domain - likely want to be the same as your theme. 'menu' => 'tgmpa-install-plugins', // Menu slug 'has_notices' => true, // Show admin notices or not 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not 'message' => '', // Message to output right before the plugins table 'strings' => array( 'page_title' => esc_html__( 'Install Required Plugins', 'taskereasy' ), 'menu_title' => esc_html__( 'Install Plugins', 'taskereasy' ), 'installing' => esc_html__( 'Installing Plugin: %s', 'taskereasy' ), // %1$s = plugin name 'oops' => esc_html__( 'Something went wrong with the plugin API.', 'taskereasy' ), 'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'taskereasy' ), // %1$s = plugin name(s) 'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'taskereasy' ), // %1$s = plugin name(s) 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'taskereasy' ), // %1$s = plugin name(s) 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' , 'taskereasy'), // %1$s = plugin name(s) 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'taskereasy' ), // %1$s = plugin name(s) 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' , 'taskereasy'), // %1$s = plugin name(s) 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'taskereasy' ), // %1$s = plugin name(s) 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'taskereasy' ), // %1$s = plugin name(s) 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'taskereasy' ), 'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins', 'taskereasy' ), 'return' => esc_html__( 'Return to Required Plugins Installer', 'taskereasy' ), 'plugin_activated' => esc_html__( 'Plugin activated successfully.', 'taskereasy' ), 'complete' => esc_html__( 'All plugins installed and activated successfully. %s', 'taskereasy' ), // %1$s = dashboard link 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated' or 'error' ) ); tgmpa( $plugins, $config ); } add_action( 'tgmpa_register', 'taskereasy_register_required_plugins' ); /** * Activation Key function. * * @since 2.0.0 */ if (!function_exists('taskereasy_activation')) { function taskereasy_activation() { $status = get_option( 'theme_activation' ); $user_license = get_option('user_license'); if(empty($status) && $status != 'none'){ update_option( 'theme_activation', 'none' ); } ?>

    error)){ if( $purchase_data->item->id != '23832008' ) { echo '

    '.__( 'Invalid License Key!', 'taskereasy' ).'

    '; } else{ update_option( 'user_license', $_POST['key'] ); update_option( 'theme_activation', 'activated' ); echo '

    '.__( 'Valid license key, please refresh your page.', 'taskereasy' ).'

    '; } }else{ echo '

    '.__( 'Invalid License Key!', 'taskereasy' ).'

    '; } }elseif( isset( $_POST['unlink-domain'] ) && wp_verify_nonce( $_POST['api_nonce_field'], 'api_nonce' ) && !empty($user_license) ){ update_option( 'user_license', '' ); update_option( 'theme_activation', 'none' ); echo '

    '.__( 'Domain Unlinked successfully, please refresh your page.', 'taskereasy' ).'

    '; } } } function verify_envato_purchase_code($code_to_verify) { $url = "https://api.envato.com/v3/market/author/sale?code=".$code_to_verify; $personal_token = "0xwVOzxFyTMvX1SIJdErkgUhe6kuv8GY"; $headers = array( 'Authorization' => 'Bearer ' . $personal_token, 'Accept' => 'application/json;ver=1.0', 'Content-Type' => 'application/json; charset=UTF-8', 'timeout' => 20, ); $request = array( 'headers' => $headers, ); $response = wp_remote_request( $url, $request ); $envatoRes = json_decode($response['body']); // Return output return $envatoRes; }