__('Home', 'call-center-bpo'), 'menu-item-classes' => 'home', 'menu-item-url' => home_url('/'), 'menu-item-status' => 'publish', )); wp_update_nav_menu_item($call_center_bpo_menu_id, 0, array( 'menu-item-title' => __('Products', 'call-center-bpo'), 'menu-item-classes' => 'products', 'menu-item-url' => get_permalink(get_page_id_by_title('Products')), 'menu-item-status' => 'publish', )); wp_update_nav_menu_item($call_center_bpo_menu_id, 0, array( 'menu-item-title' => __('Collection', 'call-center-bpo'), 'menu-item-classes' => 'collection', 'menu-item-url' => get_permalink(get_page_id_by_title('Collection')), 'menu-item-status' => 'publish', )); wp_update_nav_menu_item($call_center_bpo_menu_id, 0, array( 'menu-item-title' => __('Shop', 'call-center-bpo'), 'menu-item-classes' => 'shop', 'menu-item-url' => get_permalink(get_page_id_by_title('Shop')), 'menu-item-status' => 'publish', )); wp_update_nav_menu_item($call_center_bpo_menu_id, 0, array( 'menu-item-title' => __('Blog', 'call-center-bpo'), 'menu-item-classes' => 'blog', 'menu-item-url' => get_permalink(get_page_id_by_title('Blog')), 'menu-item-status' => 'publish', )); wp_update_nav_menu_item($call_center_bpo_menu_id, 0, array( 'menu-item-title' => __('Gift Card', 'call-center-bpo'), 'menu-item-classes' => 'gift-card', 'menu-item-url' => get_permalink(get_page_id_by_title('Gift Card')), 'menu-item-status' => 'publish', )); wp_update_nav_menu_item($call_center_bpo_menu_id, 0, array( 'menu-item-title' => __('Customize', 'call-center-bpo'), 'menu-item-classes' => 'customize', 'menu-item-url' => get_permalink(get_page_id_by_title('Customize')), 'menu-item-status' => 'publish', )); if (!has_nav_menu($call_center_bpo_bpmenulocation)) { $locations = get_theme_mod('nav_menu_locations'); $locations[$call_center_bpo_bpmenulocation] = $call_center_bpo_menu_id; set_theme_mod('nav_menu_locations', $locations); } } } public function setup_widgets() { $call_center_bpo_home_id=''; $call_center_bpo_home_content = ''; $call_center_bpo_home_title = 'Home'; $call_center_bpo_home = array( 'post_type' => 'page', 'post_title' => $call_center_bpo_home_title, 'post_content' => $call_center_bpo_home_content, 'post_status' => 'publish', 'post_author' => 1, 'post_slug' => 'home' ); $call_center_bpo_home_id = wp_insert_post($call_center_bpo_home); add_post_meta( $call_center_bpo_home_id, '_wp_page_template', 'frontpage.php' ); update_option( 'page_on_front', $call_center_bpo_home_id ); update_option( 'show_on_front', 'page' ); // Create a Posts Page $call_center_bpo_blog_title = 'Products'; $call_center_bpo_blog_check = get_page_id_by_title($call_center_bpo_blog_title); if ($call_center_bpo_blog_check == 1) { $call_center_bpo_blog = array( 'post_type' => 'page', 'post_title' => $call_center_bpo_blog_title, 'post_status' => 'publish', 'post_author' => 1, 'post_name' => 'products', 'post_content' => '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."', ); $call_center_bpo_blog_id = wp_insert_post($call_center_bpo_blog); if (!is_wp_error($call_center_bpo_blog_id)) { // update_option('page_for_posts', $call_center_bpo_blog_id); } } // Create a Posts Page $call_center_bpo_blog_title = 'Collection'; $call_center_bpo_blog_check = get_page_id_by_title($call_center_bpo_blog_title); if ($call_center_bpo_blog_check == 1) { $call_center_bpo_blog = array( 'post_type' => 'page', 'post_title' => $call_center_bpo_blog_title, 'post_status' => 'publish', 'post_author' => 1, 'post_name' => 'collection', 'post_content' => '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."', ); $call_center_bpo_blog_id = wp_insert_post($call_center_bpo_blog); if (!is_wp_error($call_center_bpo_blog_id)) { // update_option('page_for_posts', $call_center_bpo_blog_id); } } // Create a Posts Page $call_center_bpo_blog_title = 'Shop'; $call_center_bpo_blog_check = get_page_id_by_title($call_center_bpo_blog_title); if ($call_center_bpo_blog_check == 1) { $call_center_bpo_blog = array( 'post_type' => 'page', 'post_title' => $call_center_bpo_blog_title, 'post_status' => 'publish', 'post_author' => 1, 'post_name' => 'shop', 'post_content' => '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."', ); $call_center_bpo_blog_id = wp_insert_post($call_center_bpo_blog); if (!is_wp_error($call_center_bpo_blog_id)) { // update_option('page_for_posts', $call_center_bpo_blog_id); } } // Create a Posts Page $call_center_bpo_blog_title = 'Blog'; $call_center_bpo_blog_check = get_page_id_by_title($call_center_bpo_blog_title); if ($call_center_bpo_blog_check == 1) { $call_center_bpo_blog = array( 'post_type' => 'page', 'post_title' => $call_center_bpo_blog_title, 'post_status' => 'publish', 'post_author' => 1, 'post_name' => 'blog', 'post_content' => '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."', ); $call_center_bpo_blog_id = wp_insert_post($call_center_bpo_blog); if (!is_wp_error($call_center_bpo_blog_id)) { // update_option('page_for_posts', $call_center_bpo_blog_id); } } // Create a Posts Page $call_center_bpo_blog_title = 'Gift Card'; $call_center_bpo_blog_check = get_page_id_by_title($call_center_bpo_blog_title); if ($call_center_bpo_blog_check == 1) { $call_center_bpo_blog = array( 'post_type' => 'page', 'post_title' => $call_center_bpo_blog_title, 'post_status' => 'publish', 'post_author' => 1, 'post_name' => 'gift-card', 'post_content' => '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."', ); $call_center_bpo_blog_id = wp_insert_post($call_center_bpo_blog); if (!is_wp_error($call_center_bpo_blog_id)) { // update_option('page_for_posts', $call_center_bpo_blog_id); } } // Create a Posts Page $call_center_bpo_blog_title = 'Customize'; $call_center_bpo_blog_check = get_page_id_by_title($call_center_bpo_blog_title); if ($call_center_bpo_blog_check == 1) { $call_center_bpo_blog = array( 'post_type' => 'page', 'post_title' => $call_center_bpo_blog_title, 'post_status' => 'publish', 'post_author' => 1, 'post_name' => 'customize', 'post_content' => '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."', ); $call_center_bpo_blog_id = wp_insert_post($call_center_bpo_blog); if (!is_wp_error($call_center_bpo_blog_id)) { // update_option('page_for_posts', $call_center_bpo_blog_id); } } //---Header--// set_theme_mod( 'call_center_bpo_header_button_text', 'Get a Quote'); set_theme_mod( 'call_center_bpo_header_button_url', '#'); set_theme_mod('call_center_bpo_social_links_settings', array( array( "link_text" => "fab fa-instagram", "link_url" => "#" ), array( "link_text" => "fab fa-twitter", "link_url" => "#" ), array( "link_text" => "fab fa-youtube", "link_url" => "#" ), array( "link_text" => "fab fa-linkedin-in", "link_url" => "#" ) )); set_theme_mod( 'call_center_bpo_header_phone_number', '+1800-214-144'); set_theme_mod( 'call_center_bpo_header_phone_text', 'Talk To An Expert'); //-----Slider-----// set_theme_mod( 'call_center_bpo_blog_box_enable', true); set_theme_mod( 'call_center_bpo_slider_button_2_link', '#'); set_theme_mod( 'call_center_bpo_blog_slide_number', '3' ); $call_center_bpo_latest_post_category = wp_create_category('Slider Post'); set_theme_mod( 'call_center_bpo_blog_slide_category', 'Slider Post' ); for($i=1; $i<=3; $i++) { $content = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'; $title=array('Choose the Best Call Center Service for Your Company','Find The Right Call Center Service For Your Business','Choose the Best Call Center Service for Your Company'); // Create post object $call_center_bpo_my_post = array( 'post_title' => wp_strip_all_tags($title[$i-1]), 'post_content' => $content, 'post_status' => 'publish', 'post_type' => 'post', 'post_category' => array($call_center_bpo_latest_post_category) ); // Insert the post into the database $call_center_bpo_post_id = wp_insert_post( $call_center_bpo_my_post ); $call_center_bpo_image_url = get_template_directory_uri().'/assets/images/slider'.$i.'.png'; $call_center_bpo_image_name= 'slider'.$i.'.png'; $call_center_bpo_upload_dir = wp_upload_dir(); // Set upload folder $call_center_bpo_image_data = file_get_contents($call_center_bpo_image_url); // Get image data $call_center_bpo_unique_file_name = wp_unique_filename( $call_center_bpo_upload_dir['path'], $call_center_bpo_image_name ); // Generate unique name $filename= basename( $call_center_bpo_unique_file_name ); // Create image file name // Check folder permission and define file location if( wp_mkdir_p( $call_center_bpo_upload_dir['path'] ) ) { $file = $call_center_bpo_upload_dir['path'] . '/' . $filename; } else { $file = $call_center_bpo_upload_dir['basedir'] . '/' . $filename; } // Create the image file on the server if ( ! function_exists( 'WP_Filesystem' ) ) { require_once( ABSPATH . 'wp-admin/includes/file.php' ); } WP_Filesystem(); global $wp_filesystem; if ( ! $wp_filesystem->put_contents( $file, $call_center_bpo_image_data, FS_CHMOD_FILE ) ) { wp_die( 'Error saving file!' ); } $call_center_bpo_wp_filetype = wp_check_filetype( $filename, null ); $call_center_bpo_attachment = array( 'post_mime_type' => $call_center_bpo_wp_filetype['type'], 'post_title' => sanitize_file_name( $filename ), 'post_content' => '', 'post_type' => 'post', 'post_status' => 'inherit' ); $call_center_bpo_attach_id = wp_insert_attachment( $call_center_bpo_attachment, $file, $call_center_bpo_post_id ); require_once(ABSPATH . 'wp-admin/includes/image.php'); $call_center_bpo_attach_data = wp_generate_attachment_metadata( $call_center_bpo_attach_id, $file ); wp_update_attachment_metadata( $call_center_bpo_attach_id, $call_center_bpo_attach_data ); set_post_thumbnail( $call_center_bpo_post_id, $call_center_bpo_attach_id ); } //--------------Blog Section-----------// set_theme_mod( 'call_center_bpo_services_enable', true); set_theme_mod( 'call_center_bpo_services_short_heading', 'SOLUTIONS' ); set_theme_mod( 'call_center_bpo_services_heading', 'Call Center Solutions' ); set_theme_mod( 'call_center_bpo_services_number', '4' ); $call_center_bpo_latest_post_category_1 = wp_create_category('Blog Post'); set_theme_mod( 'call_center_bpo_services_category', 'Blog Post' ); for($i=1; $i<=4; $i++) { $content = 'consectetur adipiscing elit sesdeed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'; $title=array('Debt Collection', 'Collaboration Services', 'Customer Service','IT Development'); // Create post object $call_center_bpo_my_post = array( 'post_title' => wp_strip_all_tags( $title[$i-1] ), 'post_content' => $content, 'post_status' => 'publish', 'post_type' => 'post', 'post_category' => array($call_center_bpo_latest_post_category_1) ); // Insert the post into the database $call_center_bpo_post_id = wp_insert_post( $call_center_bpo_my_post ); $call_center_bpo_image_url = get_template_directory_uri().'/assets/images/services'.$i.'.png'; $call_center_bpo_image_name= 'services'.$i.'.png'; $call_center_bpo_upload_dir = wp_upload_dir(); // Set upload folder $call_center_bpo_image_data_1 = file_get_contents($call_center_bpo_image_url); // Get image data $call_center_bpo_unique_file_name = wp_unique_filename( $call_center_bpo_upload_dir['path'], $call_center_bpo_image_name ); // Generate unique name $filename= basename( $call_center_bpo_unique_file_name ); // Create image file name // Check folder permission and define file location if( wp_mkdir_p( $call_center_bpo_upload_dir['path'] ) ) { $file = $call_center_bpo_upload_dir['path'] . '/' . $filename; } else { $file = $call_center_bpo_upload_dir['basedir'] . '/' . $filename; } // Create the image file on the server if ( ! function_exists( 'WP_Filesystem' ) ) { require_once( ABSPATH . 'wp-admin/includes/file.php' ); } WP_Filesystem(); global $wp_filesystem; if ( ! $wp_filesystem->put_contents( $file, $call_center_bpo_image_data_1, FS_CHMOD_FILE ) ) { wp_die( 'Error saving file!' ); } $call_center_bpo_wp_filetype = wp_check_filetype( $filename, null ); $call_center_bpo_attachment = array( 'post_mime_type' => $call_center_bpo_wp_filetype['type'], 'post_title' => sanitize_file_name( $filename ), 'post_content' => '', 'post_type' => 'post', 'post_status' => 'inherit' ); $call_center_bpo_attach_id = wp_insert_attachment( $call_center_bpo_attachment, $file, $call_center_bpo_post_id ); require_once(ABSPATH . 'wp-admin/includes/image.php'); $call_center_bpo_attach_data = wp_generate_attachment_metadata( $call_center_bpo_attach_id, $file ); wp_update_attachment_metadata( $call_center_bpo_attach_id, $call_center_bpo_attach_data ); set_post_thumbnail( $call_center_bpo_post_id, $call_center_bpo_attach_id ); } } } // Instantiate the class and call its methods $demo_importer = new CallCenterBpoDemoImporter(); $demo_importer->setup_widgets(); $demo_importer->call_center_bpo_customizer_primary_menu(); } ?>