problem with paths wordpress in subfolder
-
i moved kernel files wordpress to a subfolder
now have a folder “content” and “kernel” at root
and got some problems
some commands only work with subfolder “kernel”
for example…
i use this function for to add changetime for name js and cssfunction put_modified_time_version($src, $baseUrl){ if ($src && strpos($src, $baseUrl) === 0) { $newSrc = remove_query_arg('ver', $src); $path = substr($newSrc, strlen($baseUrl)); $path = wp_parse_url($path, PHP_URL_PATH); if ($mtime = @filemtime(untrailingslashit(ABSPATH) . $path)) { $src = add_query_arg('ver', $mtime, $newSrc); } } return $src; } add_filter('style_loader_src', 'modified_time_version_style', 15, 1); function modified_time_version_style($src) { return ($src) ? put_modified_time_version($src, wp_styles()->base_url) : $src; } add_filter('script_loader_src', 'modified_time_version_script', 15, 1); function modified_time_version_script($src) { return ($src) ? put_modified_time_version($src, wp_scripts()->base_url) : $src; }
this works only for js and css in “kernel” folder
function work from a folder “content”
think that a problem with$url = substr($newSrc, strlen($baseUrl));
tell me how it is better to specify it correctly so that everything would work?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘problem with paths wordpress in subfolder’ is closed to new replies.