0

here is code

function custom_theme_script(){
    wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.css' );

    wp_enqueue_style('bootstrap');

    wp_register_style('style', get_template_directory_uri() . '/css/style.css');

    wp_enqueue_style('style');

       wp_deregister_script( 'jquery' );
    wp_enqueue_script('bootstrap.min', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '3.5.1', true );
}

add_action('wp_enqueue_scripts', 'custom_theme_script');`

this is screenshot of head tag enter image description here

what is missing in header.php and functions.php file

1
  • That ought to work fine as long as you're calling wp_head. Where did you put your code? Is it definitely being run? Do you not see the scripts in the page? You didn't flag any of your scripts $in_footer=true, but are you calling wp_footer() on your page too? – Rup Nov 18 '20 at 11:32
1

Hey bro Use this code get_stylesheet_directory_uri

function custom_theme_script(){
    wp_register_style('bootstrap', get_stylesheet_directory_uri.() .'/css/bootstrap.css' );

    wp_enqueue_style('bootstrap');

    wp_register_style('style', get_stylesheet_directory_uri() . '/css/style.css');

    wp_enqueue_style('style');

       wp_deregister_script( 'jquery' );
    wp_enqueue_script('bootstrap.min', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '3.5.1', true );
}

add_action('wp_enqueue_scripts', 'custom_theme_script');

`

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.