ID ); } // 4. Permalinks — set to post name update_option( 'permalink_structure', '/%postname%/' ); flush_rewrite_rules(); // 5. Build the Primary navigation menu ots_build_primary_menu(); // 6. Disable comments site-wide (marketing site) update_option( 'default_comment_status', 'closed' ); update_option( 'default_ping_status', 'closed' ); // 7. Set timezone update_option( 'timezone_string', 'America/New_York' ); // 8. Mark setup as done update_option( 'ots_setup_done', '1' ); } function ots_build_primary_menu() { // Delete existing menu with same name if any $existing = get_term_by( 'name', 'Primary Menu', 'nav_menu' ); if ( $existing ) { wp_delete_nav_menu( $existing->term_id ); } $menu_id = wp_create_nav_menu( 'Primary Menu' ); if ( is_wp_error( $menu_id ) ) return; $menu_pages = [ [ 'slug' => 'home', 'label' => 'Home' ], [ 'slug' => 'services', 'label' => 'Services' ], [ 'slug' => 'about', 'label' => 'About' ], [ 'slug' => 'contact', 'label' => 'Contact' ], ]; foreach ( $menu_pages as $item ) { $page = get_page_by_path( $item['slug'] ); if ( ! $page ) continue; wp_update_nav_menu_item( $menu_id, 0, [ 'menu-item-title' => $item['label'], 'menu-item-object-id' => $page->ID, 'menu-item-object' => 'page', 'menu-item-type' => 'post_type', 'menu-item-status' => 'publish', ] ); } // Assign menu to the 'primary' theme location $locations = get_theme_mod( 'nav_menu_locations', [] ); $locations['primary'] = $menu_id; set_theme_mod( 'nav_menu_locations', $locations ); } // ─── Admin notice ───────────────────────────────────────────────────────────── add_action( 'admin_notices', 'ots_setup_admin_notice' ); function ots_setup_admin_notice() { if ( ! current_user_can( 'manage_options' ) ) return; $done = get_option( 'ots_setup_done' ); ?>
Your site has been configured:
• Front page set to Home
• Primary navigation menu created (Home, Services, About, Contact)
• Permalink structure set to /%postname%/
• Comments disabled site-wide
Go to Plugins to delete this setup plugin View Site
The OTS Signs setup plugin is installed but hasn't run yet.
Make sure you have imported ots-signs-import.xml via
Tools → Import → WordPress first, then deactivate and reactivate this plugin.