unthinkable.fm
No Result
View All Result
  • Home
  • BUSINESS
  • FASHION
  • LIFESTYLE
  • TECHNOLOGY
  • HOME IMPROVEMENT
  • CBD
  • HEALTH
  • CRYPTOCURRENCY
  • PETS
  • MORE
    • ENTERTAINMENT
    • INTERNET
    • GAMES & SPORTS
    • REVIEWS
  • Home
  • BUSINESS
  • FASHION
  • LIFESTYLE
  • TECHNOLOGY
  • HOME IMPROVEMENT
  • CBD
  • HEALTH
  • CRYPTOCURRENCY
  • PETS
  • MORE
    • ENTERTAINMENT
    • INTERNET
    • GAMES & SPORTS
    • REVIEWS
No Result
View All Result
unthinkable.fm
No Result
View All Result
Home INTERNET

Bootstrap & WordPress Theme Integration In 8 Simple Steps

by ahmed bajwa
February 22, 2022
in INTERNET
5 min read
0
Bootstrap And WordPress Theme Integration

WordPress has been a popular blogging platform in recent years, but many people are still unsure how to use it for their business. Creating a WordPress theme that utilizes Bootstrap’s grid system, hence simplifying web development, is one of the most significant (and challenging) undertakings. Continue reading to learn about the benefits of using Bootstrap for WordPress, as well as tried-and-true methods for integrating these technologies.

Table of Contents

Toggle
  • The benefits of combining Bootstrap and WordPress themes
  • Bootstrap should be unpacked into a separate folder
  • Bootstrap configuration
  • A step-by-step guide to Bootstrap and WordPress integration
  • Copy And Paste The Code
  • Form The Header And Footer Sections.
  • Appearance Of The Featured Posts
  • Make A List Of Your Categories
  • Display The Most Recently Posted Items
  • Include Bootstrap
  • Conclusion:

The benefits of combining Bootstrap and WordPress themes

Bootstrap is a free and open-source framework for creating responsive websites. When you use it with WordPress, you won’t have to spend hours coding your site’s code, which could take months if you cloned the Bootstrap source and kept tweaking it. Instead of working with a free but limited template, you can save time by building a custom theme from start. If you follow these directions, you can combine them in only eight simple steps.

Bootstrap should be unpacked into a separate folder

When developing a WordPress theme, it’s best to use a child theme so that you don’t lose any modifications if you upgrade to the current version of WordPress or make code errors. The parent theme has three folders: images, JavaScript, and CSS. You’ll need to copy them to the child theme directory and make a new bootstrap folder in the CSS directory.

Bootstrap configuration

To begin, create a page template called page-template.php. At the conclusion of the code, you’ll include a link to your own CSS. As an example, consider the following code:

/*

Theme Name: MyTheme

Theme URI: <THEME_URL>

Description: A Theme for WordPress with Bootstrap for styling.

Author: <AUTHOR_NAME>

Author URI: <AUTHOR_URL>

Version: 1.0

*/

A step-by-step guide to Bootstrap and WordPress integration

The CSS, JavaScript, and font files are all included in the Bootstrap source code in a separate folder. You may modify your site with the Bootstrap Builder tool by selecting from a variety of options. The following is the procedure for combining these two:

Copy And Paste The Code

All CSS files should be copied to your child theme directory. You’ve now finished the theme’s primary file (style.css). Activate your new style sheet in Appearance > Theme Settings. Changes should be saved in theme files, and then a link to the new style sheet should be included.

Form The Header And Footer Sections.

You can now add sections to your WordPress site for the header and footer. In the themes folder, create a header.php file and add the following content:

<!DOCTYPE html>

<!–[if lt IE 7]><html class=”no-js lt-ie9 lt-ie8 lt-ie7″> <![endif]–>

<!–[if IE 7]><html class=”no-js lt-ie9 lt-ie8″> <![endif]–>

<!–[if IE 8]><html class=”no-js lt-ie9″> <![endif]–>

<!–[if gt IE 8]><!–> <html class=”no-js”> <!–<![endif]–>

<head>

<meta charset=”utf-8″>

<meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″>

<title><?php wp_title(‘&laquo;’, true, ‘right’); ?> <?php bloginfo(‘name’); ?></title>

<meta name=”description” content=””>

<meta name=”author” content=””>

<meta name=”viewport” content=”width=device-width”>

<link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />

<?php wp_head(); ?>

</head>

<body <?php body_class(); ?>>

<nav class=”navbar navbar-expand-md navbar-dark fixed-top bg-dark”>

<a class=”navbar-brand” href=”#”>

<?php bloginfo(‘name’); ?>

</a>

<button class=”navbar-toggler” type=”button” data-toggle=”collapse” data-target=”#navbarCollapse” aria-controls=”navbarCollapse” aria-expanded=”false” aria-label=”Toggle navigation”>

<span class=”navbar-toggler-icon”></span>

</button>

<div class=”collapse navbar-collapse” id=”navbarCollapse”>

<ul class=”navbar-nav mr-auto”>

<li class=”nav-item active”>

<a class=”nav-link” href=”/”>

Home <span class=”sr-only”>(current)</span>

</a>

</li>

</ul>

</div>

</nav>

You should create a footer by adding the following content to the footer.php file:

<footer>

</footer>

< ?php wp_footer(); ?>

</body>

</html>

Appearance Of The Featured Posts

You’ll need to add the following code to your index.php file to see the featured posts:

<?php

query_posts(‘posts_per_page=1’);

while(have_posts()) : the_post(); ?>

<div>

<h2><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></h2>

<p><?php the_excerpt(); ?></p>

</div>

<?php endwhile; wp_reset_query(); ?>

Make A List Of Your Categories

In a WordPress theme, there are two ways to display categories:

The Featured Posts plugin is an option you should consider. This plugin creates a widget that displays the majority of WordPress pages at once.

Another option is to paste the following code into the index.php file:

<div class=”panel panel-default panel-body”>

<div>

<div>

<ul>

<?php wp_list_categories(‘orderby=name&title_li=’); ?>

</ul>

</div>

</div>

</div>

Display The Most Recently Posted Items

We want to present the most recent blog posts on our homepage at the end of these settings. If you require this, simply paste the following code into the file:

<div>

<?php while(have_posts()) : the_post(); ?>

<h3><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></h3>

<p><?php the_excerpt(); ?></p>

<p> posted by <?php the_author(); ?>

<?php endwhile; wp_reset_query(); ?>

</div>

Include Bootstrap

You should include Bootstrap in the functions.php file after you’ve finished adding all of the information and code to the template. Fill in the blanks with the following code:

<?php

function themebs_enqueue_styles() {

wp_enqueue_style( ‘bootstrap’, get_template_directory_uri() . ‘/css/bootstrap.min.css’ );

wp_enqueue_style( ‘core’, get_template_directory_uri() . ‘/style.css’ );

}

add_action( ‘wp_enqueue_scripts’, ‘themebs_enqueue_styles’);

function themebs_enqueue_scripts() {

wp_enqueue_script( ‘bootstrap’, get_template_directory_uri() . ‘/js/vendor/bootstrap.bundle.min.js’, array( ‘jquery’ ) );

}

add_action( ‘wp_enqueue_scripts’, ‘themebs_enqueue_scripts’);

Additional information about including CSS files may be found in the WordPress Theme documentation.

Conclusion:

Using Bootstrap with WordPress is a terrific alternative for developers and businesses who would prefer to design a custom theme than work with a pre-made template or a free theme. You may construct a responsive site without having to code the HTML and CSS yourself using this connection.

Previous Post

How Your Sleeping Position Affects Your Health: Your Rude Awakening

Next Post

10 Best Vipbox Alternatives For Free Sports Streaming Online

ahmed bajwa

ahmed bajwa

Related Posts

FOK959S-M Model Number
INTERNET

How to Find FOK959S-M Model Number: Ultimate Guide

May 15, 2025
shining star driving school in wethersfield ct
INTERNET

Shining Star Driving School Wethersfield, CT – License Suspension Update

May 11, 2025
newznav.com 8888996650
INTERNET

Newznav.com 8888996650: Navigating the News Platform and Phone Number Concerns

May 2, 2025
enye in keyboard
INTERNET

The Complete Guide to Typing Enye (Ñ/ñ): Tips, Shortcuts, and Codes

May 1, 2025
Next Post
Best Vipbox Alternatives For Free Sports Streaming Online

10 Best Vipbox Alternatives For Free Sports Streaming Online

About Us

Get the latest news,Health, Fitness, Beauty, Food, Tech Tips, and Tricks on Fashion Trends, and Home Decor. Everything trendy is one place.

Mail ID – [email protected]

Follow Us Google News
  • Write for us
  • Privacy Policy
  • Radical
  • Contact Us
  • Tech Article

Unthinkable © Copyright 2020, All Rights Reserved

No Result
View All Result
  • Home
  • BUSINESS
  • FASHION
  • LIFESTYLE
  • TECHNOLOGY
  • HOME IMPROVEMENT
  • CBD
  • HEALTH
  • CRYPTOCURRENCY
  • PETS
  • MORE
    • ENTERTAINMENT
    • INTERNET
    • GAMES & SPORTS
    • REVIEWS

Unthinkable © Copyright 2020, All Rights Reserved