Black Friday Sale! Get up to $30 off GP Premium! Learn more ➝

[Resolved] Enque Bootstrap

Home Forums Support [Resolved] Enque Bootstrap

Home Forums Support Enque Bootstrap

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #235572
    Ciaran

    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

    #235586
    Tom
    Lead Developer
    Lead Developer

    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 🙂

    #235629
    Ciaran

    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

    View post on imgur.com

    View post on imgur.com

    http://sws.themebly.com/

    #235692
    Tom
    Lead Developer
    Lead Developer

    Hmm, not seeing why that wouldn’t work.

    Maybe try putting it in the functions.php file?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.