Click here to Skip to main content
15,884,739 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
<?php 

function load_css(){
    
    wp_enqueue_style('load_css', get_theme_file_uri('/style.css'));
    wp_enqueue_style('bootstrap-cdn-css', 'https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css');
    wp_enqueue_script('bootstrap-cdn-js', 'https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js', 'jquery', false, true);

    // 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') ); 
   
}


add_action('wp_enqueue_scripts', 'load_css');


What I have tried:

In style.css, I have given body { color: orange; } it is not showing me orange color for heading in index.php, it means style.css not loaded correctly. and I want to load boostrap.js file for footer and style.css must work correctly. Could somebody help me to solve the error?
Posted
Updated 18-Jul-21 6:47am

1 solution

Wrong file name function.php. It is Functions.php. Problem solved. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900