Site logo

Archived topic

Enque Bootstrap

3 replies · Started by Ciaran on October 15, 2016

Viewing posts 1–4 of 4

Hi Tom,

I would like to enqueue the Bootstrap grid classes only into GeneratePress. How is the best way to do that as I will only ever use the Bootstrap grid classes for building.

Ciaran

First you would create a new build in bootstrap and be sure to only include the grid classes.

Then you would enqueue it with a function like this:

add_action('wp_enqueue_scripts', 'example_enqueue_styles');
function example_enqueue_styles() {
    wp_enqueue_style('child-theme-grid', get_stylesheet_directory_uri() .'/bootstrap-grid-file.css', array());
}

This would assume your filename is bootstrap-grid-file.css and was inside your root child theme folder.

Hope this helps :)

Tom,

Firstly, thank you for responding.

I added the Enqueue the way you outlined but it does not show up when looking at the page source.

I have bootstrap.css file directly in the root of the child theme, and the enqueue in the functions.php where it needs to be.

Presently I am simply creating a custom area using the GP Hooks after header. I have created a simple row with a few columns to see if the child will load the bootstrap. The section I am working on with bootstrap is under the black Sydney skyline header.

Screenshots in these links below
http://imgur.com/a/XkIvy

http://imgur.com/a/4T6GJ

http://sws.themebly.com/

Hmm, not seeing why that wouldn't work.

Maybe try putting it in the functions.php file?

This archived topic is closed to new replies.