tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Menu', 'business-insider' ), ) ); /* * 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', ) ); /* * Adding Thumbnail basic support */ add_theme_support( 'post-thumbnails' ); /* * Adding support for Widget edit icons in customizer */ add_theme_support( 'customize-selective-refresh-widgets' ); /* * Enable support for Post Formats. * See http://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'business_insider_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Set up the WordPress Theme logo feature. add_theme_support( 'custom-logo' ); // Check and setup theme default settings. business_insider_setup_theme_default_settings(); } } add_filter( 'excerpt_more', 'business_insider_custom_excerpt_more' ); if ( ! function_exists( 'business_insider_custom_excerpt_more' ) ) { /** * Removes the ... from the excerpt read more link * * @param string $more The excerpt. * * @return string */ function business_insider_custom_excerpt_more( $more ) { return ''; } } add_filter( 'wp_trim_excerpt', 'business_insider_all_excerpts_get_more_link' ); if ( ! function_exists( 'business_insider_all_excerpts_get_more_link' ) ) { /** * Adds a custom read more link to all excerpts, manually or automatically generated * * @param string $post_excerpt Posts's excerpt. * * @return string */ function business_insider_all_excerpts_get_more_link( $post_excerpt ) { return $post_excerpt . ' [...]

' . __( 'Read More...', 'business-insider' ) . '

'; } } /** * Add update to pro button */ function business_insider_update_button() { //$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; $min = ''; wp_register_script( 'business-insider-update-button-scripts', get_template_directory_uri() . '/js/pro-update'. $min .'.js', array("jquery"), '20120206', true ); wp_localize_script( 'business-insider-update-button-scripts', 'updateButtonObj', array( 'pro' => __('Update to PRO version','business-insider') ) ); wp_enqueue_script( 'business-insider-update-button-scripts' ); } add_action( 'customize_controls_enqueue_scripts', 'business_insider_update_button' ); /** *TGM Plugin activation. */ add_action( 'tgmpa_register', 'business_insider_activate_recommended_plugins' ); /** * Register recommended plugins. */ if(!function_exists('business_insider_activate_recommended_plugins')) { function business_insider_activate_recommended_plugins() { $plugins = array( array( 'name' => __( 'Elementor Page Builder', 'business-insider' ), 'slug' => 'elementor', 'required' => false, ), array( 'name' => esc_html__( 'One Click Demo Import', 'business-insider' ), 'slug' => 'one-click-demo-import', 'required' => false, ), ); //$config = array(); $config = array( 'id' => 'business-insider', 'default_path' => '', 'menu' => 'tgmpa-install-plugins', 'has_notices' => true, 'dismissable' => true, 'dismiss_msg' => '', 'is_automatic' => false, 'message' => '', ); tgmpa( $plugins, $config ); } } /** * Imports predefine demos. * @return [type] [description] */ add_filter( 'pt-ocdi/import_files', 'business_insider_ocdi_import_files' ); if(!function_exists('business_insider_ocdi_import_files')) { function business_insider_ocdi_import_files() { return array( array( 'import_file_name' => 'Demo Import', 'import_file_url' => get_template_directory_uri() . '/import-data/import-data.xml', ), ); } } /** * * Automatically assign "Front page", "Posts page" and menu locations after the importer is done * */ function business_insider_ocdi_after_import_setup() { // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Home' ); $blog_page_id = get_page_by_title( 'Blog' ); update_option( 'show_on_front', 'page' ); update_option( 'page_on_front', $front_page_id->ID ); update_option( 'page_for_posts', $blog_page_id->ID ); //Set Menu $top_menu = get_term_by('name', 'site main menu', 'nav_menu'); set_theme_mod( 'nav_menu_locations' , array( 'primary' => $top_menu->term_id, ) ); // Set widget to left sidebar $active_widgets = get_option( 'sidebars_widgets' ); if(empty($active_widgets['left-sidebar'])) { $end = array(end($active_widgets['right-sidebar'])); $active_widgets['left-sidebar'] = $end; array_pop($active_widgets['right-sidebar']); update_option('sidebars_widgets', $active_widgets); } } add_action( 'pt-ocdi/after_import', 'business_insider_ocdi_after_import_setup' ); // Disable the ProteusThemes branding notice after successful demo import add_filter( 'pt-ocdi/disable_pt_branding', '__return_true' );