admin管理员组

文章数量:1122826

I'm in the process of migrating a legacy Bootstrap 3 website with around 300 pages to WordPress. I'm planning to use GeneratePress as the theme and WPBakery Page Builder along with some additional plugins.

As a developer relatively new to WordPress, I'm looking for some guidance on the best approach for this bulk migration. My initial plan was:

  1. Create a Child Theme: To bulk convert all the html pages to WP and make the site work.
  2. Prioritize Important Pages: I'd like to migrate the most critical pages to the new style first to get them running smoothly on the WordPress site.
  3. Phased Migration: Once the core functionality is established, I can gradually convert the remaining pages while keeping the site operational.

Here's my main concern:

Coexistence of Old and New Pages: One concern I have is that WordPress uses pre-defined templates like header, footer, and menus. My question is: can I have both the old Bootstrap pages and the newly designed pages coexist until the migration is complete? This would allow me to utilize the existing templates on the old pages while building the new ones in WordPress.

I'm in the process of migrating a legacy Bootstrap 3 website with around 300 pages to WordPress. I'm planning to use GeneratePress as the theme and WPBakery Page Builder along with some additional plugins.

As a developer relatively new to WordPress, I'm looking for some guidance on the best approach for this bulk migration. My initial plan was:

  1. Create a Child Theme: To bulk convert all the html pages to WP and make the site work.
  2. Prioritize Important Pages: I'd like to migrate the most critical pages to the new style first to get them running smoothly on the WordPress site.
  3. Phased Migration: Once the core functionality is established, I can gradually convert the remaining pages while keeping the site operational.

Here's my main concern:

Coexistence of Old and New Pages: One concern I have is that WordPress uses pre-defined templates like header, footer, and menus. My question is: can I have both the old Bootstrap pages and the newly designed pages coexist until the migration is complete? This would allow me to utilize the existing templates on the old pages while building the new ones in WordPress.

Share Improve this question asked Jun 15, 2024 at 14:17 SamuelSamuel 1011 bronze badge 1
  • "WPBakery Page Builder" - I would not do that. I would learn how to do it by hand if at all possible. Breaking free of these hideous page builders is the the ways forwards. – mayersdesign Commented Jun 16, 2024 at 8:44
Add a comment  | 

1 Answer 1

Reset to default 0

Yes, you can have both the old Bootstrap pages and the newly designed WordPress pages coexist until the migration is complete. Here’s how you can achieve this:

  1. Create a Child Theme:

    // functions.php
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
    function enqueue_parent_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    }
    
  2. Include Bootstrap 3 CSS:

    // functions.php
    function enqueue_bootstrap() {
        wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/path/to/bootstrap.min.css' );
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_bootstrap' );
    
  3. Create a Template for Old Pages:

    // template-old-page.php
    <?php
    /* Template Name: Old Page Template */
    get_header();
    ?>
    <div class="container">
        <!-- Include your old Bootstrap HTML here -->
    </div>
    <?php
    get_footer();
    ?>
    
  4. Add New Pages Using WPBakery: Use WPBakery Page Builder to create new pages. For each page, you can select a different template if needed.

  5. Custom Header and Footer for Old Pages:

    // header-old.php
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
        <meta charset="<?php bloginfo( 'charset' ); ?>">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <?php wp_head(); ?>
    </head>
    <body <?php body_class(); ?>>
        <!-- Your old Bootstrap header code -->
    
    // footer-old.php
    <!-- Your old Bootstrap footer code -->
    <?php wp_footer(); ?>
    </body>
    </html>
    
  6. Use Conditional Logic in Header and Footer:

    // header.php
    if ( is_page_template( 'template-old-page.php' ) ) {
        get_template_part( 'header', 'old' );
    } else {
        // Default header
    }
    
    // footer.php
    if ( is_page_template( 'template-old-page.php' ) ) {
        get_template_part( 'footer', 'old' );
    } else {
        // Default footer
    }
    

By following this approach, you can ensure that your old Bootstrap pages will coexist with your new WordPress pages, allowing a phased migration without breaking the site.

本文标签: themesMigrating a Bootstrap 3 Website to WordPress