WordPress的自定义主题-更改将资源文件夹路径

我正在使用Wordpress中的自定义主题, 我想将模板资源(CSS, JS, IMG)的路径更改为主题的当前根文件夹中的模板资源(CSS, JS, IMG)。

我知道我必须使用get_template_repository_uri()函数并创建自定义路径, 但我不知道该怎么做。

有谁能够帮助我 ?


#1


这是一个示例:你需要在主题的functions.php中添加代码。

/**
 * Enqueues scripts and styles.
 */
function skb_scripts() {
  wp_enqueue_style( 'skb-style', get_template_directory_uri() . '/assets/dist/css/styles.css' );
  wp_enqueue_script('jquery');  
  wp_enqueue_script( 'skb-scripts', get_template_directory_uri() . '/assets/dist/js/main.js', array(), '', true );
}
add_action( 'wp_enqueue_scripts', 'skb_scripts' );

来源:

https://www.srcmini02.com/66077.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_40650.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?