I basically want the output of get_stylesheet_directory_uri()
, but without http(s) and the domain.
2 Answers
Use parse_url()
, because it exists exactly for that reason:
$path = parse_url( get_stylesheet_directory_uri(), PHP_URL_PATH );
Chris Cox’ solution will fail when the wp-content
directory runs under a different domain than the rest of the site.