Wordpress获取模板目录uri()不工作

Wordpress获取模板目录uri()不工作,wordpress,wordpress-theming,Wordpress,Wordpress Theming,这是header.php代码,我在其中使用了get\u template\u directory\u uri(),它对我不起作用,它没有检测css文件、js文件以及我正在使用的所有文件get\u template\u directory\u uri() 我正在使用wamp,并且我已经在wamp中启用了rewrite_模块 Header.php <!DOCTYPE html> <html> <head> <title><?php bloginf

这是header.php代码,我在其中使用了
get\u template\u directory\u uri()
,它对我不起作用,它没有检测css文件、js文件以及我正在使用的所有文件
get\u template\u directory\u uri()

我正在使用wamp,并且我已经在wamp中启用了rewrite_模块

Header.php

<!DOCTYPE html>
<html>
<head>
<title><?php bloginfo('title'); ?></title>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -->
<link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/layout/styles/layout.css" type="text/css" />
<script type="text/javascript" src="<?php echo get_template_directory_uri();?>/layout/scripts/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo get_template_directory_uri();?>/layout/scripts/jquery.jcarousel.pack.js"></script>
<script type="text/javascript" src="<?php echo get_template_directory_uri();?>/layout/scripts/jquery.jcarousel.setup.js"></script>
<?php wp_head(); ?>
</head>
<body id="top">
<div class="wrapper col1">
  <div id="header">
    <div id="logo">
      <h1><a href="index.html"><?php bloginfo('name'); ?></a></h1>
      <p><?php bloginfo('description'); ?></p>
    </div>
    <div id="topnav">
      <?php wp_nav_menu(); ?>
    </div>
    <br class="clear" />
  </div>
</div>
<?php 
if(is_home() || is_front_page()){

  get_template_part("inc/slider");
}
?>


使用wp_enqueue_script()和wp_enqueue_style()而不是@VidyaLB所说的方式来包含css和js文件是不正确的。另外,如果您在页面中回显
get\u template\u directory\u uri()
,您会得到什么?