我正在尝试实现Bootstrap Tour,一个带有Bootstrap主题的Wordpress站点,但到目前为止,每次我尝试链接样式表(CSS)和JavaScrit时,它都不起作用。页面不会加载样式表或javascript。
当我在本地工作时,所有的设置都工作得很好,但当我尝试在wordpress上实现时,却什么都不起作用。
在wordpress上有没有特定的方法来设置所有的样式表和javascript?
这是我的标题:
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<?php if (is_search()) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<title>
<?php wp_title('|', true, 'right'); ?>
</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri();?>/css/bootstrap.css">
<!-- Add custom CSS here -->
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri();?>/css/bootstrap-tour.min.css">
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri();?>/css/landing-page.css">
<script type="text/javascript" src="<?php echo get_template_directory_uri();?>/js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="<?php echo get_template_directory_uri();?>/js/bootstrap.js"></script>
<script type="text/javascript" src="<?php echo get_template_directory_uri();?>/js/bootstrap-tour.min.js"></script>
<script type="text/javascript" src="<?php echo get_template_directory_uri();?>/js/script.js"></script>
<link rel="shortcut icon" href="/favicon.ico">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>发布于 2014-06-20 04:13:54
如果您使用的是child theme,get_template_directory_uri()将提供parent theme的路径
对于子主题,请改用get_stylesheet_directory_uri()。
https://stackoverflow.com/questions/24315254
复制相似问题