簡體   English   中英

正在處理自定義的wordpress主題,然后遇到麻煩:wp_enqueue_scripts

[英]Working on custom wordpress theme and having trouble with next: wp_enqueue_scripts

我正在嘗試將自己的主題添加到wp主題中。 但是我收到下一個錯誤:
http://something.comget_template_drectory_uri/css/non.css?ver = 1.0.0 net :: ERR_NAME_NOT_RESOLVED

我的文檔路徑有問題嗎?

接下來是functions.php的路徑:/home/something/something.com/wp-content/themes/something/functions.php

並在要排隊的文件旁邊:/home/something/something.com/wp-content/themes/something/css/nono.css

<?php

    function nono_scrypt_enqueue (){

    wp_enqueue_style('customstyle',get_template_drectory_uri.'/css/nono.css',array(),'1.0.0', 'all' );
    wp_enqueue_script('customjs',get_template_drectory_uri.'/js/createO.js',array(),'1.0.0', 'all' );    
    }

    add_action( 'wp_enqueue_scripts', 'nono_scrypt_enqueue' );

書中有一個錯字(d 教區長),也get_template_directory_uri()的函數,因此,如果你把括號它只會工作。 更改get_template_drectory_uriget_template_directory_uri()它應該工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM