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:
- Create a Child Theme: To bulk convert all the html pages to WP and make the site work.
- 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.
- 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:
- Create a Child Theme: To bulk convert all the html pages to WP and make the site work.
- 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.
- 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
1 Answer
Reset to default 0Yes, 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:
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' ); }
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' );
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(); ?>
Add New Pages Using WPBakery: Use WPBakery Page Builder to create new pages. For each page, you can select a different template if needed.
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>
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
版权声明:本文标题:themes - Migrating a Bootstrap 3 Website to WordPress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736303626a1931951.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论