WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wordpress paths (3 posts)

  1. luckylisbon
    Member
    Posted 7 years ago #

    I´m installed a fresh copy of wordpress, and I´m designing my new theme, but whem I try to include javascript files on the header I have to give an absolute path to them i.e. http:///www....../wp-content/themes/mytheme/js/file.js,but I remmember on older versions I had only to do wp-content/themes/etc

    is this the new way?

    And with images too, I have to give an absolute path

  2. ceejayoz
    Member
    Posted 7 years ago #

    Use something like:

    <?php echo get_bloginfo('template_directory'); ?>/js/file.js

    That way, if someone renames the theme folder, or has the theme installed in a subdirectory, it'll still work.

  3. luckylisbon
    Member
    Posted 7 years ago #

    I will try.
    Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags