SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict revlimiter's Avatar
    Join Date
    Sep 2005
    Location
    British Columbia, Canada
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Not Sourcing Full Domain Name (http://...) in Source Code?

    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?
    Thanks,
    "To make an apple pie from scratch,
    you must first create the universe.
    -Carl Sagan

  2. #2
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you just want the relative path (from site root) to your theme directory then you can do this:
    PHP Code:
    <?php echo parse_urlget_template_directory_uri(), PHP_URL_PATH ); ?>
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •