Created
November 12, 2013 16:07
-
-
Save geraintp/7433502 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
# Prepare the location of the slider's folder to enable movement accross folders | |
// $path = dirname(__FILE__); | |
// $path = str_replace('\\', '/', $path); | |
// $path = str_replace(str_replace('\\', '/', ABSPATH), '', $path); | |
// $path = trailingslashit(site_url()) . $path; | |
// $path = trailingslashit($path); | |
# Fix wrong path code! | |
$file = str_replace('\\','/', dirname(__FILE__)); // sanitize for Win32 installs | |
$file = preg_replace('|/+|','/', $file ); // remove any duplicate slash | |
$path = get_template_directory(); | |
// get relative path from theme dir | |
$file = preg_replace('#^' . preg_quote($path, '#') . '/#','',$file); | |
// Build correct URL | |
$path = trailingslashit(get_template_directory_uri()) . trim($file, '/'); | |
$path = trailingslashit($path); | |
$this->url = $path; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment