WordPress.org

Ready to get started?Download WordPress

Forums

Images / Directory Problem, Absoulte URL vs Relative URL (6 posts)

  1. jackmarshall
    Member
    Posted 3 years ago #

    I am having an issue with using images located in my images directory inside of my theme folder

    This blog here works properly: http://buenolisto.com/

    When I code for an image I only need the directory structure that looks like this: images/bg_header.jpg

    Even though the full url is: http://buenolisto.com/wp-content/themes/bueno-listo/images/bg_header.jpg

    The problem I am having is on this blog: http://www.foreclosuresnewportrichey.com/

    On this blog I cannot get an image to display from the image folder within my theme: http://www.foreclosurenewportrichey.com/wp-content/themes/twentyten/images/big_tim_circle.jpg

    This links give me an invalid request message

    Ideally, I want to code my site with a directory structure similar to the bueno-listo site shown above whereby I only need this in the code to render the image:

    images/big_tim_circle.jpg

    Right now I have all the images coded in for absolute URLS from the media folder and that is not easy or efficient.

    I know there must be some settings I am missing some where, any help would be appreciated.

  2. elfin
    Moderator
    Posted 3 years ago #

  3. jackmarshall
    Member
    Posted 3 years ago #

    Yes that...I want to program the site images like this

    <img src="images/big_tim_circle.jpg" />

    But when I do that I get 404 error or redirected to the home page.

    I do not want to have to use absolute URL's

    Does this makes sense?

  4. jackmarshall
    Member
    Posted 3 years ago #

    Can you explain how to use

    <?php get_template_directory() ?>

  5. jackmarshall
    Member
    Posted 3 years ago #

    I tried this solution and still nothing.

    I am confused, it I change themes on bueno listo all the images files still work because I have used relative URL's

    Is there a function that calls get_template_directory or something that would apply to all files/images in the theme directory.

    I can't figure out why it works on one site but not the other.

  6. imran110ali
    Member
    Posted 2 years ago #

    Try to use
    <?php bloginfo('template_directory'); ?>/images/

Topic Closed

This topic has been closed to new replies.

About this Topic