• hi.is it possible to enqueue bootstrap.css in a child theme function.php file.i had tried it.but it does not work.why?
    thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Can you post the contents of your child theme’s functions.php? If it’s very long, post it to Pastebin or Gist instead.

    Thread Starter majidazadi

    (@majidazadi)

    here is enqeue script part of function.php.
    function add_theme_scripts() {
    $parent_style = ‘parent-style’;

    wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘child-style’,
    get_stylesheet_directory_uri() . ‘/style.css’,
    array( $parent_style ),
    wp_get_theme()->get(‘Version’)
    );

    wp_enqueue_style( ‘bootstrap’, get_stylesheet_directory_uri() . ‘/css/bootstrap.css’, array($parent_style));

    if ( is_singular() && comments_open() && get_option( ‘thread_comments’ ) ) {
    wp_enqueue_script( ‘comment-reply’ );
    }
    }
    add_action( ‘wp_enqueue_scripts’, ‘add_theme_scripts’ ,11);

    • This reply was modified 8 years, 2 months ago by majidazadi.

    From a quick glance at your code, I can’t see anything that would prevent Bootstrap from loading. Is bootstrap.css located in at path-to-your-child-theme/css/bootstrap.css? Can you post a link to your site with the child theme active?

    Thread Starter majidazadi

    (@majidazadi)

    it is there.bootstrap.css.but its strange my child theme style work even after omiting enqueue it from child function.php file.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘enqueue bootstrap’ is closed to new replies.