__('Home', 'business-article-ship'),
'menu-item-url' => home_url('/'),
'menu-item-status' => 'publish',
));
wp_update_nav_menu_item($business_article_ship_menu_id, 0, array(
'menu-item-title' => __('About Us', 'business-article-ship'),
'menu-item-url' => home_url('/index.php/about-us/'),
'menu-item-status' => 'publish',
));
wp_update_nav_menu_item($business_article_ship_menu_id, 0, array(
'menu-item-title' => __('Services', 'business-article-ship'),
'menu-item-url' => home_url('/index.php/services/'),
'menu-item-status' => 'publish',
));
wp_update_nav_menu_item($business_article_ship_menu_id, 0, array(
'menu-item-title' => __('Pages', 'business-article-ship'),
'menu-item-url' => home_url('/index.php/pages/'),
'menu-item-status' => 'publish',
));
wp_update_nav_menu_item($business_article_ship_menu_id, 0, array(
'menu-item-title' => __('Blog', 'business-article-ship'),
'menu-item-url' => home_url('/index.php/blog/'),
'menu-item-status' => 'publish',
));
// Set menu to location
$business_article_ship_locations = get_theme_mod('nav_menu_locations');
if (!is_array($business_article_ship_locations)) {
$business_article_ship_locations = array();
}
$business_article_ship_locations[$business_article_ship_menulocation] = $business_article_ship_menu_id;
set_theme_mod('nav_menu_locations', $business_article_ship_locations);
}
}
// POST and update the customizer and other related data of Business Article Ship
if (isset($_POST['submit'])) {
// -------- Plugin Installation and Activation (WooCommerce & Classic Widgets) -------- //
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
include_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php');
include_once(ABSPATH . 'wp-admin/includes/file.php');
include_once(ABSPATH . 'wp-admin/includes/misc.php');
// Plugin list
$business_article_ship_plugins = array(
array(
'slug' => 'classic-widgets',
'file' => 'classic-widgets/classic-widgets.php',
'download_url' => 'https://downloads.wordpress.org/plugin/classic-widgets.zip'
)
);
foreach ($business_article_ship_plugins as $plugin) {
$installed_plugins = get_plugins();
// Install the plugin if it's not installed
if (!isset($installed_plugins[$plugin['file']])) {
$upgrader = new Plugin_Upgrader();
$upgrader->install($plugin['download_url']);
}
// Activate the plugin if it's not active
if (file_exists(WP_PLUGIN_DIR . '/' . $plugin['file']) && !is_plugin_active($plugin['file'])) {
activate_plugin($plugin['file']);
}
}
// ------- Create Menu --------
business_article_ship_create_customizer_nav_menu();
// ------- Create Pages --------
function create_demo_page($title, $content = '', $template = '') {
$page_id = business_article_ship_get_page_id_by_title($title);
if (!$page_id) {
$page_data = array(
'post_type' => 'page',
'post_title' => $title,
'post_content' => $content,
'post_status' => 'publish',
'post_author' => 1,
);
$page_id = wp_insert_post($page_data);
if ($template && !is_wp_error($page_id)) {
update_post_meta($page_id, '_wp_page_template', $template);
}
}
return $page_id;
}
$business_article_ship_home_id = create_demo_page('Home', '', 'home/home.php');
update_option('page_on_front', $business_article_ship_home_id);
update_option('show_on_front', 'page');
create_demo_page('Pages', 'Lorem Ipsum ...
');
create_demo_page('About Us', 'Lorem Ipsum ...
');
create_demo_page('Services', 'Service description...
');
create_demo_page('Blog', 'Blog page content here...
');
// ------- Set Theme Mods --------
set_theme_mod('business_article_ship_topbar_text', 'Welcome to Business');
set_theme_mod('business_article_ship_topbar_career_button_link', '#');
set_theme_mod('business_article_ship_topbar_service_button_link', '#');
set_theme_mod('business_article_ship_topbar_contact_button_link', '#');
set_theme_mod('business_article_ship_social_media1_heading', 'www.facebook.com');
set_theme_mod('business_article_ship_social_media2_heading', 'www.instagram.com');
set_theme_mod('business_article_ship_social_media3_heading', 'www.twitter.com');
set_theme_mod('business_article_ship_social_media4_heading', 'www.youtube.com');
// ------- Banner Section --------
$business_article_ship_banner_headings = array('Transforming Ideas into Reality', 'Bringing Concepts to Life');
set_theme_mod('business_article_ship_banner_slider_increase', 2);
for ($i = 1; $i <= 2; $i++) {
set_theme_mod("business_article_ship_banner_image$i", get_template_directory_uri() . "/img/banner$i.png");
set_theme_mod("business_article_ship_banner_heading$i", $business_article_ship_banner_headings[$i - 1]);
set_theme_mod("business_article_ship_banner_text$i", 'Lorem ipsum dolor sit amet...');
set_theme_mod("business_article_ship_banner_button_link$i", '#');
}
// ------- Services Section --------
set_theme_mod('business_article_ship_services_small_heading', 'Start Now!');
set_theme_mod('business_article_ship_services_main_heading', 'Where Business Meets Brilliance');
set_theme_mod('business_article_ship_services_text', 'Aenean vestibulum tortor erat...');
set_theme_mod('business_article_ship_services_right_image', get_template_directory_uri() . '/img/serv-right.png');
$business_article_ship_service_icons = array('bi bi-bar-chart-fill', 'bi bi-cash-coin', 'bi bi-clipboard-data', 'bi bi-lightbulb-fill');
$business_article_ship_service_headings = array('Leading the Way in Innovation', 'Where Success Stories Begin', 'Excellence in Every Detail', 'Committed to Your Growth');
set_theme_mod('business_article_ship_services_increase', 4);
for ($i = 1; $i <= 4; $i++) {
set_theme_mod("business_article_ship_services_icon$i", $business_article_ship_service_icons[$i - 1]);
set_theme_mod("business_article_ship_services_inner_heading$i", $business_article_ship_service_headings[$i - 1]);
}
echo 'Demo Import Successful
';
}
?>