'Content', 'import_file_url' => 'https://demo.raman.work/businesswebx/imports/pages.xml', 'import_preview_image_url' => 'https://demo.raman.work/businesswebx/imports/pages_preview.png', ], ]; } add_filter( 'ocdi/import_files', 'ocdi_import_files' ); function ocdi_after_import_setup() { // Assign menus to their locations. $menuname = 'BusinssWebX Primary Menu'; $bpmenulocation = 'businesswebx-primary-menu'; // Does the menu exist already? $menu_exists = wp_get_nav_menu_object( $menuname ); // If it doesn't exist, let's create it. if( !$menu_exists){ $menu_id = wp_create_nav_menu($menuname); // Set up default BuddyPress links and add them to the menu. wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('Home', 'businesswebx'), 'menu-item-classes' => 'home', 'menu-item-url' => get_permalink( get_page_by_path( 'home' ) ). '/', 'menu-item-status' => 'publish')); wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('About', 'businesswebx'), 'menu-item-classes' => 'about', 'menu-item-url' => get_permalink( get_page_by_path( 'about' ) ), 'menu-item-status' => 'publish')); wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('Our Work', 'businesswebx'), 'menu-item-classes' => 'our-work', 'menu-item-url' => get_permalink( get_page_by_path( 'our-work' ) ), 'menu-item-status' => 'publish')); wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('Services', 'businesswebx'), 'menu-item-classes' => 'services', 'menu-item-url' => get_permalink( get_page_by_path( 'services' ) ), 'menu-item-status' => 'publish')); wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('Blog', 'businesswebx'), 'menu-item-classes' => 'blog', 'menu-item-url' => get_permalink( get_page_by_path( 'blog' ) ), 'menu-item-status' => 'publish')); wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('Contact', 'businesswebx'), 'menu-item-classes' => 'contact', 'menu-item-url' => get_permalink( get_page_by_path( 'contact' ) ), 'menu-item-status' => 'publish')); } // Grab the theme locations and assign our newly-created menu // to the BuddyPress menu location. if( !has_nav_menu( $bpmenulocation ) ){ $locations = get_theme_mod('nav_menu_locations'); $locations[$bpmenulocation] = $menu_id; set_theme_mod( 'nav_menu_locations', $locations ); } // $main_menu = get_term_by( 'name', $menuname, 'nav_menu' ); // set_theme_mod( 'nav_menu_locations', [ // 'businesswebx-primary-menu' => $main_menu->term_id, // ] // ); // 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 ); } add_action( 'ocdi/after_import', 'ocdi_after_import_setup' ); function ocdi_register_plugins( $plugins ) { $theme_plugins = array( // This is an example of how to include a plugin from the WordPress Plugin Repository. array( 'name' => 'Elementor', 'slug' => 'elementor', 'required' => true, ), // This is an example of how to include a plugin from the WordPress Plugin Repository. array( 'name' => 'One Click Demo Import', 'slug' => 'one-click-demo-import', 'required' => true, ), // This is an example of how to include a plugin from the WordPress Plugin Repository. array( 'name' => 'Contact Form by WPForms', 'slug' => 'wpforms-lite', 'required' => true, ), ); return array_merge( $plugins, $theme_plugins ); } add_filter( 'ocdi/register_plugins', 'ocdi_register_plugins' );