admin管理员组文章数量:1328378
Am new to WordPress theme. I tried writing this little code and got this
Warning: Use of undefined constant all - assumed 'all' (this will throw an Error in a future version of PHP) in C:\Users........ on line 6
Line 6 referring to:
wp_enqueue_style('style', get_stylesheet_uri(), NULL, microtime(), all);
This is the functions.php
code:
<?php
// adding the CSS and JS files
function gt_setup(){
wp_enqueue_style('style', get_stylesheet_uri(), NULL, microtime(), all);
wp_enqueue_script('main', get_theme_file_uri('/js/main.js'), NULL, microtime(), true);
}
add_action('wp_enqueue_scripts', 'gt_setup');
And this is the style.css
code:
body{
background:red;
}
header.php
code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GTCoding</title>
<?php wp_head(); ?>
</head>
<body>
<header>
<h1>Header Here</h1>
</header>
footer.php
code:
<footer>
<p>Footer goes here</p>
</footer>
<?php wp_footer(); ?>
</body>
</html>
JS code:
alert("hi from main.js");
本文标签:
版权声明:本文标题:css - Warning: Use of undefined constant all - assumed 'all' (this will throw an Error in a future version of PH 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742232956a2437557.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论