' . esc_html__('Your demo import has been completed successfully.', 'artist-portfolio') . '

'; echo '' . esc_html__('VIEW SITE', 'artist-portfolio') . ''; } if (isset($_POST['submit'])) { // ------- Create Nav Menu -------- $artist_portfolio_menuname = 'Main Menus'; $artist_portfolio_bpmenulocation = 'primary'; $artist_portfolio_menu_exists = wp_get_nav_menu_object($artist_portfolio_menuname); if (!$artist_portfolio_menu_exists) { $artist_portfolio_menu_id = wp_create_nav_menu($artist_portfolio_menuname); // Create Home Page $artist_portfolio_home_title = 'Home'; $artist_portfolio_home = array( 'post_type' => 'page', 'post_title' => $artist_portfolio_home_title, 'post_content' => '', 'post_status' => 'publish', 'post_author' => 1, 'post_slug' => 'home' ); $artist_portfolio_home_id = wp_insert_post($artist_portfolio_home); // Assign Home Page Template add_post_meta($artist_portfolio_home_id, '_wp_page_template', 'page-template/home-page.php'); // Update options to set Home Page as the front page update_option('page_on_front', $artist_portfolio_home_id); update_option('show_on_front', 'page'); // Add Home Page to Menu wp_update_nav_menu_item($artist_portfolio_menu_id, 0, array( 'menu-item-title' => __('Home', 'artist-portfolio'), 'menu-item-classes' => 'home', 'menu-item-url' => home_url('/'), 'menu-item-status' => 'publish', 'menu-item-object-id' => $artist_portfolio_home_id, 'menu-item-object' => 'page', 'menu-item-type' => 'post_type' )); // Create About Us Page with Dummy Content $artist_portfolio_about_title = 'About Us'; $artist_portfolio_about_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...
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960 with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which dont look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isnt anything embarrassing hidden in the middle of text.
All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.'; $artist_portfolio_about = array( 'post_type' => 'page', 'post_title' => $artist_portfolio_about_title, 'post_content' => $artist_portfolio_about_content, 'post_status' => 'publish', 'post_author' => 1, 'post_slug' => 'about-us' ); $artist_portfolio_about_id = wp_insert_post($artist_portfolio_about); // Add About Us Page to Menu wp_update_nav_menu_item($artist_portfolio_menu_id, 0, array( 'menu-item-title' => __('About Us', 'artist-portfolio'), 'menu-item-classes' => 'about-us', 'menu-item-url' => home_url('/about-us/'), 'menu-item-status' => 'publish', 'menu-item-object-id' => $artist_portfolio_about_id, 'menu-item-object' => 'page', 'menu-item-type' => 'post_type' )); // Create Pages Page with Dummy Content $artist_portfolio_shop_title = 'Shop'; $artist_portfolio_shop_content = 'Explore all the shop we have on our website. Find information about our services, company, and more. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960 with the release of Letraset sheets containing Lorem Ipsum passages, and more shoply with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.'; $artist_portfolio_shop = array( 'post_type' => 'page', 'post_title' => $artist_portfolio_shop_title, 'post_content' => $artist_portfolio_shop_content, 'post_status' => 'publish', 'post_author' => 1, 'post_slug' => 'shop' ); $artist_portfolio_shop_id = wp_insert_post($artist_portfolio_shop); // Add Pages Page to Menu wp_update_nav_menu_item($artist_portfolio_menu_id, 0, array( 'menu-item-title' => __('Shop', 'artist-portfolio'), 'menu-item-classes' => 'shop', 'menu-item-url' => home_url('/shop/'), 'menu-item-status' => 'publish', 'menu-item-object-id' => $artist_portfolio_shop_id, 'menu-item-object' => 'page', 'menu-item-type' => 'post_type' )); // Create Pages Page with Dummy Content $artist_portfolio_blog_title = 'Blog'; $artist_portfolio_blog_content = 'Explore all the blog we have on our website. Find information about our services, company, and more. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960 with the release of Letraset sheets containing Lorem Ipsum passages, and more blogly with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.'; $artist_portfolio_blog = array( 'post_type' => 'page', 'post_title' => $artist_portfolio_blog_title, 'post_content' => $artist_portfolio_blog_content, 'post_status' => 'publish', 'post_author' => 1, 'post_slug' => 'blog' ); $artist_portfolio_blog_id = wp_insert_post($artist_portfolio_blog); // Add Pages Page to Menu wp_update_nav_menu_item($artist_portfolio_menu_id, 0, array( 'menu-item-title' => __('Blog', 'artist-portfolio'), 'menu-item-classes' => 'blog', 'menu-item-url' => home_url('/blog/'), 'menu-item-status' => 'publish', 'menu-item-object-id' => $artist_portfolio_blog_id, 'menu-item-object' => 'page', 'menu-item-type' => 'post_type' )); // Create Pages Page with Dummy Content $artist_portfolio_contact_title = 'Contact Us'; $artist_portfolio_contact_content = 'Explore all the contact we have on our website. Find information about our services, company, and more. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960 with the release of Letraset sheets containing Lorem Ipsum passages, and more contactly with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.'; $artist_portfolio_contact = array( 'post_type' => 'page', 'post_title' => $artist_portfolio_contact_title, 'post_content' => $artist_portfolio_contact_content, 'post_status' => 'publish', 'post_author' => 1, 'post_slug' => 'contact' ); $artist_portfolio_contact_id = wp_insert_post($artist_portfolio_contact); // Add Pages Page to Menu wp_update_nav_menu_item($artist_portfolio_menu_id, 0, array( 'menu-item-title' => __('Contact', 'artist-portfolio'), 'menu-item-classes' => 'contact', 'menu-item-url' => home_url('/contact/'), 'menu-item-status' => 'publish', 'menu-item-object-id' => $artist_portfolio_contact_id, 'menu-item-object' => 'page', 'menu-item-type' => 'post_type' )); // Set the menu location if it's not already set if (!has_nav_menu($artist_portfolio_bpmenulocation)) { $artist_portfolio_locations = get_theme_mod('nav_menu_locations'); // Use 'nav_menu_locations' to get locations array if (empty($artist_portfolio_locations)) { $artist_portfolio_locations = array(); } $artist_portfolio_locations[$artist_portfolio_bpmenulocation] = $artist_portfolio_menu_id; set_theme_mod('nav_menu_locations', $artist_portfolio_locations); } } // Set the demo import completion flag update_option('artist_portfolio_demo_import_completed', true); // Display success message and "View Site" button echo '

' . esc_html__('Your demo import has been completed successfully.', 'artist-portfolio') . '

'; echo '' . esc_html__('VIEW SITE', 'artist-portfolio') . ''; //end // Top Bar // set_theme_mod( 'artist_portfolio_phone_number', '(+00) 123 456 789' ); set_theme_mod( 'artist_portfolio_email_address', '#' ); set_theme_mod( 'artist_portfolio_topbar_location', '77 Franklin st, San Fransclso' ); set_theme_mod( 'artist_portfolio_time_icon', 'far fa-clock' ); set_theme_mod( 'artist_portfolio_time', '9 am to 6 pm' ); set_theme_mod( 'artist_portfolio_time1', 'Monday to Friday' ); set_theme_mod( 'artist_portfolio_header_btn_text', 'Book Now' ); // social icon set_theme_mod('artist_portfolio_facebook_url', '#' ); set_theme_mod('artist_portfolio_facebook_icon', 'fab fa-facebook-f' ); set_theme_mod('artist_portfolio_twitter_url', '#' ); set_theme_mod('artist_portfolio_twitter_icon', 'fab fa-twitter' ); set_theme_mod('artist_portfolio_instagram_url', '#'); set_theme_mod('artist_portfolio_instagram_icon', 'fab fa-instagram' ); set_theme_mod('artist_portfolio_pinterest_url', '#'); set_theme_mod('artist_portfolio_pinterest_icon', 'fab fa-pinterest-p' ); set_theme_mod('artist_portfolio_pinterest_url', '#'); set_theme_mod('artist_portfolio_pinterest_icon', 'fab fa-pinterest-p' ); set_theme_mod('artist_portfolio_header_btn_url', '#' ); // slider section start // set_theme_mod('artist_portfolio_slider_title', 'Persue Your Passion Create Your Life'); set_theme_mod( 'artist_portfolio_slider_bg_image', get_template_directory_uri().'/images/Slider.png'); set_theme_mod('artist_portfolio_arts_title', 'Our Arts' ); set_theme_mod('artist_portfolio_slider_btn_text', 'Explore Now' ); set_theme_mod('artist_portfolio_slider_btn_url', '#' ); set_theme_mod('artist_portfolio_slider_category', 'postcategory1' ); // event set_theme_mod('artist_portfolio_section_title', 'Our Events'); set_theme_mod('artist_portfolio_section_text', 'Lorem ipsum is simply dummy text of printing and typesetting industry.'); set_theme_mod('artist_portfolio_events_category', 'postcategory1' ); // Define post category names and post titles $artist_portfolio_category_names = array('postcategory1', 'postcategory2', 'postcategory3', 'postcategory4'); $artist_portfolio_title_array = array( array("An Artist Wordpress Theme that Displays Your Event", "Use Artist Wordpress Theme to Find Out About Art Event", "Updated Event with the Top Artist Wordpress Theme", "Showcase the Artist Event with Stylish Artist Wordpress Theme"), array("Promote Your Art Event Effectively with Wordpress", "Wordpress Themes That Attract Event Visitors", "Modern Wordpress Themes for Creative Event Promotion", "Event Ready Wordpress Themes for Artists"), array("Artistry Made Easy with Beautiful Wordpress Themes", "Engage Audiences Using Wordpress for Events", "Showcase Art Masterpieces via Wordpress Events", "Transform Art Events with Trendy Wordpress Themes"), array("Wordpress: The Go-To Platform for Art Event Promotion", "Display Art Events Using Intuitive Wordpress Themes", "Top Wordpress Designs for Artist Portfolios and Events", "Customizable Wordpress Themes for Art Exhibitions") ); $artist_portfolio_content_array = array( array("Lorem is simply dummy text of printing and typesetting industry", "Lorem is simply dummy text of printing and typesetting industry","Lorem is simply dummy text of printing and typesetting industry","Lorem is simply dummy text of printing and typesetting industry"), array("Lorem is simply dummy text of printing and typesetting industry", "Lorem is simply dummy text of printing and typesetting industry", "Lorem is simply dummy text of printing and typesetting industry", "Lorem is simply dummy text of printing and typesetting industry"), array("Lorem is simply dummy text of printing and typesetting industry", "Lorem is simply dummy text of printing and typesetting industry", "Lorem is simply dummy text of printing and typesetting industry", "Lorem is simply dummy text of printing and typesetting industry"), array("Lorem is simply dummy text of printing and typesetting industry", "Lorem is simply dummy text of printing and typesetting industry", "Lorem is simply dummy text of printing and typesetting industry", "Lorem is simply dummy text of printing and typesetting industry") ); foreach ($artist_portfolio_category_names as $artist_portfolio_index => $artist_portfolio_category_name) { // Create or retrieve the post category term ID $artist_portfolio_term = term_exists($artist_portfolio_category_name, 'category'); if ($artist_portfolio_term === 0 || $artist_portfolio_term === null) { // If the term does not exist, create it $artist_portfolio_term = wp_insert_term($artist_portfolio_category_name, 'category'); } if (is_wp_error($artist_portfolio_term)) { error_log('Error creating category: ' . $artist_portfolio_term->get_error_message()); continue; // Skip to the next iteration if category creation fails } for ($artist_portfolio_i = 0; $artist_portfolio_i < 4; $artist_portfolio_i++) { // Create post content $artist_portfolio_title = $artist_portfolio_title_array[$artist_portfolio_index][$artist_portfolio_i]; $artist_portfolio_content = $artist_portfolio_content_array[$artist_portfolio_index][$artist_portfolio_i]; // Create post post object $artist_portfolio_my_post = array( 'post_title' => wp_strip_all_tags($artist_portfolio_title), 'post_content' => $artist_portfolio_content, 'post_status' => 'publish', 'post_type' => 'post', // Post type set to 'post' 'post_excerpt' => substr($artist_portfolio_content, 0, 100) . '...', // Add an excerpt ); // Insert the post into the database $artist_portfolio_post_id = wp_insert_post($artist_portfolio_my_post); if (is_wp_error($artist_portfolio_post_id)) { error_log('Error creating post: ' . $artist_portfolio_post_id->get_error_message()); continue; // Skip to the next post if creation fails } // Assign the category to the post wp_set_post_categories($artist_portfolio_post_id, array((int)$artist_portfolio_term['term_id'])); // Handle the featured image using media_sideload_image $artist_portfolio_image_url = get_template_directory_uri() . '/images/Event' . ($artist_portfolio_i + 1) . '.png'; $artist_portfolio_image_id = media_sideload_image($artist_portfolio_image_url, $artist_portfolio_post_id, null, 'id'); if (is_wp_error($artist_portfolio_image_id)) { error_log('Error downloading image: ' . $artist_portfolio_image_id->get_error_message()); continue; // Skip to the next post if image download fails } // Assign featured image to post set_post_thumbnail($artist_portfolio_post_id, $artist_portfolio_image_id); // Add custom meta data update_post_meta($artist_portfolio_post_id, 'artist_event_date', date('Y-m-d', strtotime('+' . $artist_portfolio_i . ' days'))); update_post_meta($artist_portfolio_post_id, 'artist_event_location', 'Location ' . ($artist_portfolio_i + 1)); } } //Copyright Text set_theme_mod( 'artist_portfolio_footer_text', 'By BWThemes' ); } ?>