I was following a wp theme developement tutorial but somehow my wp_enqueue_style and wp_enqueue_script not working here is my code
functions.php
<?php
//Adding the css and js files
function gt_setup(){
wp_enqueue_style('google-fonts','https://fonts.googleapis.com/css?family=Roboto|Roboto+Condensed|Roboto+Slab');
wp_enqueue_style('font-awesome','https://use.fontawesome.com/releases/v5.1.0/css/all.css');
wp_enqueue_style('style',get_stylesheet_uri());
// wp_enqueue_script($handle,$src,$deps,$ver,$in_footer);
wp_enqueue_script('main',get_theme_file_uri('/js/main.js'),NULL,'1.0',true);
}
add_action('wp_enqueue_script','gt_setup');
?>
i have added within head in header.php and before body in footer.php
here is my style.css
/*
Theme Name:GTCoding
Author:Godson Thomas
Author URI:www.google.com
Description:Test theme
Version:1.0
*/
body{
background:red;
}
js/main.js
alert ("hello from main.js");
header.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt"
crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Roboto|Roboto+Condensed|Roboto+Slab" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<title>GTCoding</title>
<?php wp_head();?>
</head>
<body>
<header>
<h1>Header here</h1>
</header>
footer.php
<footer>
<p>Footer was here</p>
</footer>
<?php wp_footer(); ?>
</body>
</html>
index.php
<?php get_header();?>
<h2>Hi from index.php</h2>
<?php get_footer();?>
i am stuck with this for days..please help i searched the forum but i think my problem is specific..please dont mark this duplicate