CMS & WordPress
I am using the following code for sourcing to my CSS files and it works great:
<?php echo get_template_directory_uri(); ?>
However, in the source code it's showing the full domain, "http://www.website.com/wordpress-content/themes/..."
Is there any way to remove the URL from the very beginning and to just output "/wordpress-content/themes/..." instead?
I just think it looks cleaner doing it this way. Seems to do the same thing, with a few less characters. Is there any reason not to do this?
If you just want the relative path (from site root) to your theme directory then you can do this:
<?php echo parse_url( get_template_directory_uri(), PHP_URL_PATH ); ?>
This topic is now closed. New replies are no longer allowed.