Skip to:
Content
Pages
Categories
Search
Top
Bottom

relative path for custom images


  • pivey
    Participant

    @pivey

    Hello,

    i need to keep my custom images on the same level as bp-default/_inc/images

    and prefer to define a relative path rather than a absolute path like:

    <?php echo get_template_directory_uri() . ‘/_inc/customfolder/my_image.gif’ ?>

    But it does not work.

    Your help is highly appreciated

Viewing 4 replies - 1 through 4 (of 4 total)

  • pivey
    Participant

    @pivey

    stupid question?


    pivey
    Participant

    @pivey

    i prefer to use the relative path instead of using the whole domain, as when moving to a different domain, i will not need to change all customized links.

    Might be useful for others as well.. ? Please help a newbie


    Anonymous User 96400
    Inactive

    @anonymized-96400

    Well, the link you posted above in your first post will work on any domain and you won’t have to change a thing, except you might want to use get_stylesheet_directory_uri() instead of get_template_directory_uri(). The first function returns the child theme location (if there is one) while the second one returns the parent theme location.


    pivey
    Participant

    @pivey

    thank you travel junkie, you are right.

    It did not work as i added the “wp-content” path after the get_stylesheet_directory_uri() .

    Your recommendations are very helpful.

    I buy a Weissbier :-)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘relative path for custom images’ is closed to new replies.
Skip to toolbar