WordPress.org

Ready to get started?Download WordPress

Forums

Image Viewing Problems (7 posts)

  1. cycletheplanet
    Member
    Posted 7 years ago #

    I have ftp'd images to my WordPress test site. In developing a new theme based on K2, I cannot view them when using the <img> tag in the xhtml. In IE the images are displayed as red x's. In Mozilla Firefox, only the "alt" text displays.
    I have spent hours trying to work through this problem amd cannot find a solution. Is there someone out there who can help PLEASE??

    Thanks,

    Antoine (www.cycletheplanet.com -> currently switching to wordpress from joomla)

  2. Adam Brown
    Member
    Posted 7 years ago #

    The <img> tag has an incorrect src parameter set, apparently. But it's not clear to me what you did. Did you put the images into posts, or into your theme?

    When I look at your site, I see an image in the upper left, but no broken images. Maybe be a little more specific...

  3. Jeremy Clark
    Moderator
    Posted 7 years ago #

    Your not using the correct path to the images. I like to use this in my themes.
    <img src="<?php bloginfo('template_directory');>/images/image.jpg" alt="image" />
    The /images/ is the folder inside the theme directory that holds the themes. Using this if you decide to release your theme it will work no matter the structure of other's wordpress.

  4. cycletheplanet
    Member
    Posted 7 years ago #

    Just a quick reply, I can give more tomorrow.

    >> Did you put the images into posts, or into your theme?

    I put the images in my theme like this:
    I am using <img src="img/imagename">

    I have also tried with: src="/theme/themename/img"

    I have also tried with src="http://web16...

    All to no avail.

    Any more thoughts?

    Thanks for your help.

  5. cycletheplanet
    Member
    Posted 7 years ago #

    I have added:
    <img src="<?php bloginfo('template_directory');>/images/image.jpg" alt="image" />

    This crashes the site, making it go completely blank.
    Only the removal of this line from the source code of the header file resolves the problem.

    Additionally, the theme must be removed and replaced.

    Accessing the image directly such as:

    http://www.site.com/themes/themename/images.gif

    causes an error 404

    Thus, the image also does not load when it is displayed from within the code of the site.

    Does anyone have any ideas why this problem happens??

    Thanks.

  6. Jeremy Clark
    Moderator
    Posted 7 years ago #

    <img src="<?php bloginfo('template_directory');>/images/image.jpg" alt="image" />
    should have called the image if you correctly changed the paths on the code.
    If your getting a 404 error then the image either isn't there or the permissions are set wrong on the file.

  7. transitmonger
    Member
    Posted 7 years ago #

    Hi! I'm having a similar problem.

    My file is definitely there, and wordpress can reach it through the url() function. But I can't reach it by direct navigation nor through <img src="" />.

    Therefore, it must be permissions. How do I change the permissions?

Topic Closed

This topic has been closed to new replies.

About this Topic