Skip to content

Commit c6b3ba5

Browse files
committed
修复使用子主题时获取的内置插件路径错误的问题。
1 parent db538fa commit c6b3ba5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

func/wp-useragent.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
if(!defined('WP_CONTENT_DIR'))
4141
define('WP_CONTENT_DIR', ABSPATH.'wp-content');
4242
if(!defined('WP_PLUGIN_URL'))
43-
define('WP_PLUGIN_URL', get_stylesheet_directory_uri());
43+
define('WP_PLUGIN_URL', get_template_directory_uri());
4444
if(!defined('WP_PLUGIN_DIR'))
45-
define('WP_PLUGIN_DIR', get_stylesheet_directory());
45+
define('WP_PLUGIN_DIR', get_template_directory());
4646

4747
// Plugin Options
48-
$url_img=get_stylesheet_directory_uri()."/func/img/";
48+
$url_img=get_template_directory_uri()."/func/img/";
4949

5050
$ua_doctype = get_option('ua_doctype');
5151
$ua_comment_size = get_option('ua_comment_size');
@@ -62,7 +62,7 @@
6262
$ua_output_location = get_option('ua_output_location');
6363

6464
// Include our main UA detection functions
65-
include(get_stylesheet_directory().'/func/wp-useragent-detect.php');
65+
include(get_template_directory().'/func/wp-useragent-detect.php');
6666

6767
// Image generation function
6868
function clrs_img($code, $type, $title)

functions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
// 加载内置插件
4-
include( get_stylesheet_directory().'/func/wp-useragent.php');
4+
include( get_template_directory().'/func/wp-useragent.php');
55

66
// 加载语言包
77
add_action('after_setup_theme', 'my_theme_setup');
@@ -394,4 +394,4 @@ function clrs_config(){ clrs_thtj(); ?>
394394

395395
}
396396

397-
?>
397+
?>

0 commit comments

Comments
 (0)