File: /var/www/k8148-2/htdocs/www.sport-roth.at/old/wp-content/themes/daniel/inc/demo-import.php
<?php
add_action( 'admin_head', 'httheme_remove_ocdi_notice' );
function httheme_remove_ocdi_notice(){
?>
<style type="text/css">
.ocdi .notice-info{
display: none !important;
}
</style>
<?php
}
function daniel_import_files() {
return array(
array(
'import_file_name' => __( 'Standard Demo', 'daniel' ),
'local_import_file' => get_stylesheet_directory() . '/inc/demo-content/all_content.xml',
'local_import_widget_file' => get_stylesheet_directory() . '/inc/demo-content/widgets.wie',
'local_import_customizer_file' => get_stylesheet_directory() . '/inc/demo-content/daniel-export.dat',
'import_preview_image_url' => get_template_directory_uri() .'/screenshot.png',
'import_notice' => __( 'After you import this demo, you will have setup all content.', 'daniel' ),
),
array(
'import_file_name' => __( 'CommingSoon','daniel'),
'local_import_file' => get_stylesheet_directory() . '/inc/demo-content/all_content.xml',
'import_widget_file_url' => get_stylesheet_directory() . '/inc/demo-content/widgets.wie',
'local_import_customizer_file' => get_stylesheet_directory() . '/inc/demo-content/daniel-export.dat',
),
'import_preview_image_url' => get_template_directory_uri() .'/screenshot.png',
);
}
add_filter( 'pt-ocdi/import_files', 'daniel_import_files' );
////////////////////////////////////////////////////////////////////
function daniel_after_import_setup() {
// Assign menus to their locations.
$header_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' );
$footer_menu = get_term_by( 'name', 'Footer Menu', 'nav_menu' );
set_theme_mod( 'nav_menu_locations' , array(
'mainmenu' => $header_menu->term_id,
'footermenu' => $footer_menu->term_id,
)
);
// Assign front page and posts page (blog page).
// set front page
$front_page_id = get_page_by_title( 'Home Version 1' );
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
// set blog page
$blog_page_id = get_page_by_title( 'Blog Standard' );
update_option( 'page_for_posts', $blog_page_id->ID );
// set shop page
$shop_page_id = get_page_by_title('shop');
$shop_page_id = $shop_page_id ? $shop_page_id->ID : get_option( 'woocommerce_shop_page_id');
update_option( 'woocommerce_shop_page_id', $shop_page_id);
// set cart page
$cart_page_id = get_page_by_title('cart');
$cart_page_id = $cart_page_id ? $cart_page_id->ID : get_option( 'woocommerce_cart_page_id');
update_option( 'woocommerce_cart_page_id', $cart_page_id);
// set chekcout page
$checkout_page_id = get_page_by_title('checkout');
$checkout_page_id = $checkout_page_id ? $checkout_page_id->ID : get_option( 'woocommerce_checkout_page_id');
update_option( 'woocommerce_checkout_page_id', $checkout_page_id);
// set myaccount page
$account_page_id = get_page_by_title('my account ');
$account_page_id = $account_page_id ? $account_page_id->ID : get_option( 'woocommerce_myaccount_page_id');
update_option( 'woocommerce_myaccount_page_id', $account_page_id);
// set wishlist page
$wishlist_page_id = get_page_by_title('wishlist');
$wishlist_page_id = $wishlist_page_id ? $wishlist_page_id->ID : get_option( 'yith_wcwl_wishlist_page_id');
update_option( 'yith_wcwl_wishlist_page_id', $wishlist_page_id);
// disable elementor color
update_option('elementor_disable_color_schemes', 'yes');
// disable elementor font
update_option('elementor_disable_typography_schemes', 'yes');
// set content width
update_option('elementor_container_width', '1170');
// set widget space
update_option('elementor_space_between_widgets', '30');
// disable lightbox
update_option('elementor_global_image_lightbox', '');
flush_rewrite_rules();
}
add_action( 'pt-ocdi/after_import', 'daniel_after_import_setup' );