Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #225
    dan
    Participant

    Hi,

    I know for a fact that these two functions resolves a url but what is the difference between site_url() and get_theme_file_url() functions in WordPress?

    #228

    site_url() points to you rool directory such as in the same directory where wp_content and wp_admin resides

    example: site_url() resolves to http://www.mysite.com/

    get_theme_file_uri() points to theme directory of your website and is mostly use to resolves location of CSS and Javascript files

    example: get_theme_file_uri(‘images/pic.jpg’) resolves to http://www.mysite.com/wp-content/themes/sitename/images/pic.jpg

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.