2017-08-17 44 views
-1

我正在尝试将js和CSS代码元素整合到一个二十七个WordPress主题中。我使用排队方法,但它不起作用,所以建议我所有。Js nd CSS代码integrats in wordpress主题

+0

欢迎StackOverflow上。请注意,提问这样的一般问题是不鼓励的,只有在您研究了您的问题后才会发布问题,并且应该在[最少,完整和可验证的示例]中包含迄今为止的尝试以及相关代码(https: //stackoverflow.com/help/mcve)**。还请阅读[Stack Overflow用户需要多少研究工作](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users)和[我怎么问一个很好的问题](https://stackoverflow.com/help/how-to-ask) – FluffyKitten

回答

0

写在function.php这个代码

add_action('wp_enqueue_scripts', 'theme_name_scripts'); 

function theme_name_scripts() { 
    wp_enqueue_style('style-name', get_stylesheet_uri()); 
    wp_enqueue_script('script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true); 
} 
+0

已经做了所有的事情。 –