for posts and comments. add_theme_support( 'automatic-feed-links' ); /* * Switches 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' ) ); /* * This theme supports all available post formats by default. * See http://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); // This theme uses wp_nav_menu() in one location. register_nav_menu( 'primary', __( 'Navigation Menu', 'i-excel' ) ); // add title tag support since WordPress 4.1 add_theme_support( 'title-tag' ); /* * This theme uses a custom image size for featured images, displayed on * "standard" posts and pages. */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 604, 270, true ); /* * additional Image sizes. */ //add_image_size( 'iexcel-slider-thumb', 1600, 580, true ); //(cropped) add_image_size( 'iexcel-single-thumb', 1600, 580, true ); //(cropped) // Add Support for woocommerce add_theme_support( 'woocommerce' ); add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); $iexcel_defaults_bg = array( 'default-color' => '#f3f1ed', 'default-image' => get_template_directory_uri() . '/images/default-bg.png', 'default-repeat' => 'repeat-all' ); add_theme_support( 'custom-background', $iexcel_defaults_bg ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // This theme uses its own gallery styles. add_filter( 'use_default_gallery_style', '__return_false' ); } add_action( 'after_setup_theme', 'iexcel_setup' ); /** * Return the Google font stylesheet URL, if available. * * The use of Source Sans Pro and Bitter by default is localized. For languages * that use characters not supported by the font, the font can be disabled. * * @since i-excel 1.0 * * @return string Font stylesheet or empty string if disabled. */ function iexcel_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Open Sans, translate this to 'off'. Do not translate * into your own language. */ //fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,400,300,600,700|Roboto:400,400italic,500italic,700italic' $open_sans = _x( 'on', 'Open Sans font: on or off', 'i-excel' ); /* Translators: If there are characters in your language that are not * supported by Roboto, translate this to 'off'. Do not translate into your * own language. */ $roboto = _x( 'on', 'Roboto font: on or off', 'i-excel' ); if ( 'off' !== $open_sans || 'off' !== $roboto ) { $font_families = array(); if ( 'off' !== $open_sans ) $font_families[] = 'Open Sans:300,400,700,300italic,400italic,700italic'; if ( 'off' !== $roboto ) $font_families[] = 'Roboto:300,400,700'; $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" ); } return $fonts_url; } /** * Enqueue scripts and styles for the front end. * * @since i-excel 1.0 * * @return void */ function iexcel_scripts_styles() { /* * Adds JavaScript to pages with the comment form to support * sites with threaded comments (when in use). */ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); // load masonry for footer and post layout wp_enqueue_script( 'jquery-masonry' ); // Loads JavaScript file with functionality specific to i-excel. //wp_enqueue_script( 'modernizer-custom', get_template_directory_uri() . '/js/modernizr.custom.js', array( 'jquery' ), '2014-01-13', true ); // Loads JavaScript file for scroll related functions and animations. wp_enqueue_script( 'iexcel-waypoint', get_template_directory_uri() . '/js/waypoints.min.js', array( 'jquery' ), '2014-01-13', true ); // Loads JavaScript file for small screen side menu. wp_enqueue_script( 'iexcel-sidr', get_template_directory_uri() . '/js/jquery.sidr.min.js', array( 'jquery' ), '2014-01-13', true ); // Loads JavaScript file for small screen side menu. wp_enqueue_script( 'owl-carousel', get_template_directory_uri() . '/js/owl.carousel.min.js', array( 'jquery' ), '2.2.1', true ); // Loads JavaScript file with functionality specific to i-excel. wp_enqueue_script( 'iexcel-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2014-07-18', true ); $blog_layout = get_theme_mod('blog_layout', '2'); // Add Source Sans Pro and Bitter fonts, used in the main stylesheet. wp_enqueue_style( 'iexcel-fonts', iexcel_fonts_url(), array(), null ); // Add Genericons font, used in the main stylesheet. wp_enqueue_style( 'genericons', get_template_directory_uri() . '/fonts/genericons.css', array(), '2.09' ); // Add Animate stle, used used for css animations. wp_enqueue_style( 'animate', get_template_directory_uri() . '/css/animate.min.css', array(), '2014-01-12' ); // Add Animate stle, used used for side menu. wp_enqueue_style( 'iexcel-sidr', get_template_directory_uri() . '/css/jquery.sidr.dark.css', array(), '2014-01-12' ); // Add owl-carusel style wp_enqueue_style( 'owl-carousel', get_template_directory_uri() . '/css/owl.carousel.css', array(), '2.2.1' ); // Add owl-carusel theme wp_enqueue_style( 'owl-carousel-theme', get_template_directory_uri() . '/css/owl.theme.css', array(), '2.2.1' ); // Add owl-carusel transition wp_enqueue_style( 'owl-carousel-transitions', get_template_directory_uri() . '/css/owl.transitions.css', array(), '2.2.1' ); // Loads our main stylesheet. wp_enqueue_style( 'iexcel-style', get_stylesheet_uri(), array(), '2016-07-18' ); // blog posts layout style if ( $blog_layout == '2' ) { wp_enqueue_style( 'i-excel-blog-layout', get_template_directory_uri() . '/css/twocol-blog.css', array(), '2015-03-11' ); } // Loads the Internet Explorer specific stylesheet. wp_enqueue_style( 'iexcel-ie', get_template_directory_uri() . '/css/ie.css', array( 'iexcel-style' ), '2016-07-18' ); wp_style_add_data( 'iexcel-ie', 'conditional', 'lt IE 9' ); wp_enqueue_style( 'i-excel-extra-stylesheet', get_template_directory_uri() . '/css/extra-style.css', array(), '2016-03-11' ); $custom_css = wp_filter_nohtml_kses(get_theme_mod('extra_style', ''), ''); if ( $custom_css ) { wp_add_inline_style( 'i-excel-extra-stylesheet', $custom_css ); } } add_action( 'wp_enqueue_scripts', 'iexcel_scripts_styles' ); /** * add body class for boxed layout. * * @since i-excel 1.0 */ add_filter( 'body_class', 'iexcel_layout_body_class' ); function iexcel_layout_body_class( $classes ) { // add 'class-name' to the $classes array if ( get_theme_mod('wide_layout', 1) != 0 ) { $classes[] = 'nx-wide'; } else { $classes[] = 'nx-boxed'; } // return the $classes array return $classes; } /** * Register two widget areas. * * @since i-excel 1.0 * * @return void */ function iexcel_widgets_init() { register_sidebar( array( 'name' => __( 'Main Widget Area', 'i-excel' ), 'id' => 'sidebar-1', 'description' => __( 'Appears in the footer section of the site.', 'i-excel' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Main Sidebar Widget Area', 'i-excel' ), 'id' => 'sidebar-2', 'description' => __( 'Appears on posts and pages in the sidebar.', 'i-excel' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'iexcel_widgets_init' ); if ( ! function_exists( 'iexcel_paging_nav' ) ) : /** * Display navigation to next/previous set of posts when applicable. * * @since i-excel 1.0 * * @return void */ function iexcel_paging_nav() { global $wp_query; // Don't print empty markup if there's only one page. if ( $wp_query->max_num_pages < 2 ) return; ?> str_replace( $big, '%#%', get_pagenum_link( $big ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages, 'type' => 'list', 'prev_text' => '« ' . __( 'Previous', 'i-excel' ) . '', 'next_text' => '' . __( 'Next', 'i-excel' ) . ' »', 'add_args' => false ); ?> post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; ?> ' . __( 'Sticky', 'i-excel' ) . ''; if ( ! has_post_format( 'link' ) && 'post' == get_post_type() ) iexcel_entry_date(); // Translators: used between list items, there is a space after the comma. $categories_list = get_the_category_list( __( ', ', 'i-excel' ) ); if ( $categories_list ) { echo '' . $categories_list . ''; } // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list( '', __( ', ', 'i-excel' ) ); if ( $tag_list ) { echo '' . $tag_list . ''; } // Post author if ( 'post' == get_post_type() ) { printf( '', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'i-excel' ), get_the_author() ) ), get_the_author() ); } } endif; if ( ! function_exists( 'iexcel_entry_date' ) ) : /** * Print HTML with date information for current post. * * Create your own iexcel_entry_date() to override in a child theme. * * @since i-excel 1.0 * * @param boolean $echo (optional) Whether to echo the date. Default true. * @return string The HTML-formatted post date. */ function iexcel_entry_date( $echo = true ) { if ( has_post_format( array( 'chat', 'status' ) ) ) $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'i-excel' ); else $format_prefix = '%2$s'; $date = sprintf( '', esc_url( get_permalink() ), esc_attr( sprintf( __( 'Permalink to %s', 'i-excel' ), the_title_attribute( 'echo=0' ) ) ), esc_attr( get_the_date( 'c' ) ), esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) ) ); if ( $echo ) echo $date; return $date; } endif; if ( ! function_exists( 'iexcel_the_attached_image' ) ) : /** * Print the attached image with a link to the next attached image. * * @since i-excel 1.0 * * @return void */ function iexcel_the_attached_image() { /** * Filter the image attachment size to use. * * @since i-excel 1.0 * * @param array $size { * @type int The attachment height in pixels. * @type int The attachment width in pixels. * } */ $attachment_size = apply_filters( 'iexcel_attachment_size', array( 724, 724 ) ); $next_attachment_url = wp_get_attachment_url(); $post = get_post(); /* * Grab the IDs of all the image attachments in a gallery so we can get the URL * of the next adjacent image in a gallery, or the first image (if we're * looking at the last image in a gallery), or, in a gallery of one, just the * link to that image file. */ $attachment_ids = get_posts( array( 'post_parent' => $post->post_parent, 'fields' => 'ids', 'numberposts' => -1, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ); // If there is more than 1 attachment in a gallery... if ( count( $attachment_ids ) > 1 ) { foreach ( $attachment_ids as $attachment_id ) { if ( $attachment_id == $post->ID ) { $next_id = current( $attachment_ids ); break; } } // get the URL of the next image attachment... if ( $next_id ) $next_attachment_url = get_attachment_link( $next_id ); // or get the URL of the first image attachment. else $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) ); } printf( '%3$s', esc_url( $next_attachment_url ), the_title_attribute( array( 'echo' => false ) ), wp_get_attachment_image( $post->ID, $attachment_size ) ); } endif; /** * Return the post URL. * * @uses get_url_in_content() to get the URL in the post meta (if it exists) or * the first link found in the post content. * * Falls back to the post permalink if no URL is found in the post. * * @since i-excel 1.0 * * @return string The Link format URL. */ function iexcel_get_link_url() { $content = get_the_content(); $has_url = get_url_in_content( $content ); return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); } /** * Extend the default WordPress body classes. * * Adds body classes to denote: * 1. Single or multiple authors. * 2. Active widgets in the sidebar to change the layout and spacing. * 3. When avatars are disabled in discussion settings. * * @since i-excel 1.0 * * @param array $classes A list of existing body class values. * @return array The filtered body class list. */ function iexcel_body_class( $classes ) { global $post; $iexcel_page_class = ''; $iexcel_page_nopad = 0; $iexcel_no_ubar = ''; $iexcel_trans_header = 0; if ( function_exists( 'rwmb_meta' ) ) { $iexcel_page_class = rwmb_meta('iexcel_page_class'); $iexcel_page_nopad = rwmb_meta('iexcel_page_nopad'); $iexcel_no_ubar = rwmb_meta('iexcel_no_ubar'); $iexcel_trans_header = rwmb_meta('iexcel_trans_header'); } if ( ! is_multi_author() ) $classes[] = 'single-author'; if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() ) $classes[] = 'sidebar'; if ( ! get_option( 'show_avatars' ) ) $classes[] = 'no-avatars'; if( ! empty($iexcel_page_class) ) $classes[] = esc_attr($iexcel_page_class); if( $iexcel_page_nopad == 1 ) $classes[] = 'tx-nopad'; // Add PreLoader Class if( get_theme_mod('pre_loader', 0) == 1 ) $classes[] = 'nx-preloader'; // Add PreLoader Class if( get_theme_mod('exta_shadow', 0) == 1 ) $classes[] = 'extra-page-shadow'; if( $iexcel_no_ubar == 1 ) $classes[] = 'tx-noubar'; if( $iexcel_trans_header == 1 ) $classes[] = 'nx-fullscreen'; // Boxed Navigation Icons if( get_theme_mod('boxed-icons', 0) == 1 ) $classes[] = 'nx-nav-boxedicons'; // Top Nav Menu Items to UPPERCASE if( get_theme_mod('nav_upper', 0) == 1 ) $classes[] = 'nx-nav-uppercase'; if ( get_theme_mod('show_search', 1) == 1 ) { $classes[] = 'nx-show-search'; } else { $classes[] = 'nx-no-search'; } if ( is_page_template( 'page_full-width.php' ) ) { $classes[] = 'nx-full-width'; } return $classes; } add_filter( 'body_class', 'iexcel_body_class' ); /** * Adjust content_width value for video post formats and attachment templates. * * @since i-excel 1.0 * * @return void */ function iexcel_content_width() { global $content_width; if ( is_attachment() ) $content_width = 724; elseif ( has_post_format( 'audio' ) ) $content_width = 484; } add_action( 'template_redirect', 'iexcel_content_width' ); /** * Add postMessage support for site title and description for the Customizer. * * @since i-excel 1.0 * * @param WP_Customize_Manager $wp_customize Customizer object. * @return void */ function iexcel_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->selective_refresh->add_partial( 'basic', array( 'selector' => '.site-header .home-link', 'settings' => array( 'logo' ), //'render_callback' => 'twentyfifteen_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'slidersettings', array( 'selector' => '.nx-slider .nx-slider-container', 'settings' => array( 'slidersettings' ), //'render_callback' => 'twentyfifteen_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'basic-1', array( 'selector' => '.tx-topphone', 'settings' => array( 'top_phone' ), //'render_callback' => 'twentyfifteen_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'basic-2', array( 'selector' => '.tx-topmail', 'settings' => array( 'top_email' ), //'render_callback' => 'twentyfifteen_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'social-icons', array( 'selector' => '.socialicons', 'settings' => array( 'itrans_social_facebook' ), //'render_callback' => 'twentyfifteen_customize_partial_blogname', ) ); /**/ } add_action( 'customize_register', 'iexcel_customize_register' ); /** * Enqueue Javascript postMessage handlers for the Customizer. * * Binds JavaScript handlers to make the Customizer preview * reload changes asynchronously. * * @since i-excel 1.0 * * @return void */ function iexcel_customize_preview_js() { wp_enqueue_script( 'iexcel-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130226', true ); } add_action( 'customize_preview_init', 'iexcel_customize_preview_js' ); function iexcel_customizer_control() { wp_enqueue_script('customize_control_init', get_template_directory_uri() . '/js/theme-customizer-control.js', array( 'jquery' ), '1.0.1', true ); } add_action( 'customize_controls_enqueue_scripts', 'iexcel_customizer_control' ); /** * Add a stylesheet for admin panels * @since i-excel 1.0 */ add_action('admin_init', 'iexcel_admin_css'); function iexcel_admin_css() { wp_register_style( 'iexcel-admin-css', get_template_directory_uri() . '/css/admin-style.css' ); wp_enqueue_style( 'iexcel-admin-css' ); } add_action( 'admin_enqueue_scripts', 'iexcel_admin_js' ); function iexcel_admin_js() { wp_enqueue_script( 'iexcel-admin-script', get_template_directory_uri() . '/js/admin-script.js' ); } /*-----------------------------------------------------------------------------------*/ /* Metabox /*-----------------------------------------------------------------------------------*/ if ( function_exists( 'rwmb_meta' ) ) { include( get_template_directory() . '/inc/tnext-meta.php' ); } /*-----------------------------------------------------------------------------------*/ /* Custom Functions /*-----------------------------------------------------------------------------------*/ include get_template_directory() . '/inc/custom_functions.php'; include get_template_directory() . '/inc/iexcel-custom-style.php'; include get_template_directory() . '/inc/woo-functions.php'; /*-----------------------------------------------------------------------------------*/ /* Maintanance mode on /*-----------------------------------------------------------------------------------*/ $mmode_status = get_theme_mod('mmode_status', 0); if($mmode_status == 1) { include get_template_directory() . '/inc/m-mode/m-mode.php'; } /*-----------------------------------------------------------------------------------*/ /* changing default Excerpt length /*-----------------------------------------------------------------------------------*/ function iexcel_excerpt_length($length) { return 32; } add_filter('excerpt_length', 'iexcel_excerpt_length'); /*-----------------------------------------------------------------------------------*/ /* changing changing default read more text /*-----------------------------------------------------------------------------------*/ function iexcel_excerpt_more($more) { global $post; return ''. __( 'Read More...', 'i-excel' ). ''; } add_filter('excerpt_more', 'iexcel_excerpt_more'); /*-----------------------------------------------------------------------------------*/ /* Adding customizer with kirki /*-----------------------------------------------------------------------------------*/ include_once( dirname( __FILE__ ) . '/nx-customizer.php' ); include_once( dirname( __FILE__ ) . '/inc/kirki/kirki.php' ); /*-----------------------------------------------------------------------------------*/ /* Adding Responsive Menu /*-----------------------------------------------------------------------------------*/ include get_template_directory() . '/inc/responsive-menu/responsive-menu.php'; /* * Loads the Options Panel * * If you're loading from a child theme use stylesheet_directory * instead of template_directory */ // Remove WooCommerce Native Breadcrumb add_action( 'init', 'iexcel_remove_wc_breadcrumbs' ); function iexcel_remove_wc_breadcrumbs() { remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); } // Adding TGM Plugin activation require_once dirname( __FILE__ ) . '/inc/class-tgm-plugin-activation.php'; add_action( 'tgmpa_register', 'iexcel_register_required_plugins' ); function iexcel_register_required_plugins() { /** * Array of plugin arrays. Required keys are name and slug. * If the source is NOT from the .org repo, then source is also required. */ $plugins = array( // This is an example of how to include a plugin from a private repo in your theme. array( 'name' => 'TemplatesNext ToolKit', // The plugin name. 'slug' => 'templatesnext-toolkit', // The plugin slug (typically the folder name). 'required' => false, // If false, the plugin is only 'recommended' instead of required. ), ); /** * 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' => 'tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to pre-packaged plugins. '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' => __( 'Install Required Plugins', 'i-excel' ), 'menu_title' => __( 'Install Plugins', 'i-excel' ), 'installing' => __( 'Installing Plugin: %s', 'i-excel' ), // %s = plugin name. 'oops' => __( 'Something went wrong with the plugin API.', 'i-excel' ), 'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'i-excel' ), // %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.', 'i-excel' ), // %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.', 'i-excel' ), // %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.', 'i-excel' ), // %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.', 'i-excel' ), // %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.', 'i-excel' ), // %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.', 'i-excel' ), // %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.', 'i-excel' ), // %1$s = plugin name(s). 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'i-excel' ), 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'i-excel' ), 'return' => __( 'Return to Required Plugins Installer', 'i-excel' ), 'plugin_activated' => __( 'Plugin activated successfully.', 'i-excel' ), 'complete' => __( 'All plugins installed and activated successfully. %s', 'i-excel' ), // %s = dashboard link. 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. ) ); tgmpa( $plugins, $config ); } /* Demo import by One Click Demo Import */ // include get_template_directory() . '/inc/one-click-demo-import/one-click-demo-import.php'; function iexcel_import_files() { return array( /**/ array( 'import_file_name' => 'i-Excel Demo Excel-18', 'import_file_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel.wordpress-excel-18.xml', 'import_widget_file_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel-widgets.wie', 'import_customizer_file_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel-export-excel-18.dat', 'import_preview_image_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel-demo-excel-18.png', 'import_notice' => __( 'Please make sure you have plugin "TemplatesNext ToolKit" and "Contact Form 7" installed and active before you start the import process.
This process involves transfer of data and media from server to server and might take some time.', 'i-excel' ), 'preview_url' => 'http://templatesnext.org/icreate/', ), array( 'import_file_name' => 'i-Excel Demo Classic', 'import_file_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel.wordpress-1.xml', 'import_widget_file_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel-widgets.wie', 'import_customizer_file_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel-export.dat', 'import_preview_image_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel-demo-1.png', 'import_notice' => __( 'Please make sure you have plugin "TemplatesNext ToolKit" and "Contact Form 7" installed and active before you start the import process.
This process involves transfer of data and media from server to server and might take some time.', 'i-excel' ), 'preview_url' => 'http://templatesnext.org/icreate/', ), array( 'import_file_name' => 'i-Excel Demo - Page Builder', 'import_file_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel.wordpress-2.xml', 'import_widget_file_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel-widgets.wie', 'import_customizer_file_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel-export-2.dat', 'import_preview_image_url' => 'https://raw.githubusercontent.com/TemplatesNext/i-excel-demo/master/i-excel-demo-2.png', 'import_notice' => __( 'Please make sure you have plugin "TemplatesNext ToolKit" and "Contact Form 7" installed and active before you start the import process.
This process involves transfer of data and media from server to server and might take some time.', 'i-excel' ), 'preview_url' => 'http://www.templatesnext.org/icreate/?page_id=1138', ), ); } add_filter( 'pt-ocdi/import_files', 'iexcel_import_files' ); add_filter( 'pt-ocdi/disable_pt_branding', '__return_true' ); function iexcel_after_import_setup($selected_import) { if ( 'i-Excel Demo Classic' === $selected_import['import_file_name'] ) { // Assign menus to their locations. $main_menu = get_term_by( 'name', 'main nav', 'nav_menu' ); set_theme_mod( 'nav_menu_locations', array( 'primary' => $main_menu->term_id, ) ); $front_page_id = get_page_by_title( 'Front Page' ); if ( isset( $front_page_id->ID ) ) { update_option( 'page_on_front', $front_page_id->ID ); update_option( 'show_on_front', 'page' ); } } elseif ( 'i-Excel Demo - Page Builder' === $selected_import['import_file_name'] ) { // Assign menus to their locations. $main_menu = get_term_by( 'name', 'main nav', 'nav_menu' ); set_theme_mod( 'nav_menu_locations', array( 'primary' => $main_menu->term_id, ) ); $front_page_id = get_page_by_title( 'Home - Page Builder' ); if ( isset( $front_page_id->ID ) ) { update_option( 'page_on_front', $front_page_id->ID ); update_option( 'show_on_front', 'page' ); } } elseif ( 'i-Excel Demo Excel-18' === $selected_import['import_file_name'] ) { // Assign menus to their locations. $main_menu = get_term_by( 'name', 'main nav', 'nav_menu' ); set_theme_mod( 'nav_menu_locations', array( 'primary' => $main_menu->term_id, ) ); $front_page_id = get_page_by_title( 'Home - Page Builder Easy' ); if ( isset( $front_page_id->ID ) ) { update_option( 'page_on_front', $front_page_id->ID ); update_option( 'show_on_front', 'page' ); } } } add_action( 'pt-ocdi/after_import', 'iexcel_after_import_setup' ); /* Delete The default Hello World Post before import */ /* Resetting default Widgets */ function ispirit_before_content_import( $selected_import ) { wp_delete_post(1); update_option( 'sidebars_widgets', $null ); } add_action( 'pt-ocdi/before_content_import', 'ispirit_before_content_import' ); /* change title for page and menu */ function iexcel_plugin_page_setup( $default_settings ) { $default_settings['page_title'] = esc_html__( 'i-excel One Click Demo Setup', 'i-excel' ); $default_settings['menu_title'] = esc_html__( 'i-excel Demo Setup' ,'i-excel' ); return $default_settings; } add_filter( 'pt-ocdi/plugin_page_setup', 'iexcel_plugin_page_setup' ); /* function ocdi_plugin_intro_text( $default_text ) { $default_text .= '
This is a custom text added to this plugin intro text.
'; return $default_text; } add_filter( 'pt-ocdi/plugin_intro_text', 'ocdi_plugin_intro_text' ); */ /* Admin Notice for i-excel Users */ add_action('admin_notices', 'iexcel_admin_notice_007'); function iexcel_admin_notice_007() { global $current_user ; $user_id = $current_user->ID; $support_url = esc_url('https://wordpress.org/support/theme/i-excel/'); $notice_url = esc_url('https://wordpress.org/support/theme/i-excel/reviews/?filter=5'); /* Check that the user hasn't already clicked to ignore the message */ if ( ! get_user_meta($user_id, 'iexcel_ignore_notice_007') ) { echo '

'; printf(__('i-excel I-EXCEL 1.3.7 adds new features like, maintenance mode, transparent header, wide page template "TX Full Width" for page builders, etc.
', 'i-excel')); printf(__('Use the support forum to report an issue.', 'i-excel'), $support_url); echo '
'; printf(__('XDismiss This Notice
', 'i-excel' ), '?iexcel_notice_ignore_007=0'); echo "

"; } } add_action('admin_init', 'iexcel_notice_ignore_007'); function iexcel_notice_ignore_007() { global $current_user; $user_id = $current_user->ID; /* If user clicks to ignore the notice, add that to their user meta */ if ( isset($_GET['iexcel_notice_ignore_007']) && '0' == $_GET['iexcel_notice_ignore_007'] ) { add_user_meta($user_id, 'iexcel_ignore_notice_007', 'true', true); } }