我試着將我的網站WordPress的和WordPress給我錯誤的functions.php致命錯誤:調用未定義功能get_template_directory_url()
錯誤:
Fatal error: Call to undefined function get_template_directory_url() in C:\wamp\www\wordpress\wp-content\themes\ilai-portfolio\functions.php on line 3
的functions.php:
<?php
function ibsp_theme_style() {
wp_enqueue_style('bootstrap_css', get_template_directory_url() . '/bootstrap/css/bootstrap.min.css', array('ilai-portfolio-style'), '20132553');
wp_enqueue_style('style_css', get_template_directory_url() . '/style.css', array('ilai-portfolio-style'), '20132553');
wp_enqueue_style('fontawesome_css', get_template_directory_url(). '/fonts/font-awesome.min.css', array('ilai-portfolio-style'), '20132553');
wp_enqueue_style('prettyfooter_css' , get_template_directory_url() . '/css/Pretty-Footer.css', array('ilai-portfolio-style'), '20132553');
}
add_action('wp_enqueue_scripts', 'ibsp_theme_style');
function ibsp_theme_js() {
wp_enqueue_scripts('bootstrap_js', get_template_directory_url() . 'bootstrap/js/bootstrap.min.js', array('jquery'), '', true);
wp_enqueue_scripts('smoothscroll_js', get_template_directory_url() . 'js/smoothscroll.js', array('jquery'), '', true);
}
add_action('wp_enqueue_scripts', 'ibsp_theme_js');
?>
原始的功能是'get_template_directory_uri()''不get_template_directory_url()'等等。 –