WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Image Links not showing up (4 posts)

  1. koki.cf
    Member
    Posted 4 years ago #

    I initially built my entire website in HTML, and added the CSS. Everything worked fine, albeit some browser tweaks I'll make at the end (as it's the hardest part).

    Once I started dividing my content into the .php files however, things started to get odd. Everything shows up as it should, except image links in HTML. Background images in my CSS file show up fine, which is strange since all of the images are in the same folder I'm linking to.

    I'm just starting to poke my nose in PHP, and as I learn the PHP WordPress tags (it's quite fun!), things get easier, but this is an issue that's baffling me.

    As a note, I am running my current apache server under MAMP for testing (my website is at my localhost), so I'm not quite sure if that would be the problem or not. Again, the original HTML file displays everything fine - without any changes to the image paths, image links are not showing up in my php files.

    Any suggestion as to what the problem would be? I tried searching for the solution myself, but came up flat.

  2. koki.cf
    Member
    Posted 4 years ago #

    Sorry to bump. This issue was solved by using

    <?php bloginfo('template_directory') ?>/path_to_image_folder/image.extension

    If there's an easier way please let me know.

  3. CSDavidson
    Member
    Posted 3 years ago #

    Hey I encountered this problem. It can be easily resolved by linking from your wp-content folder like so...

    <img src="wp-content/themes/themename/images/1.jpg" alt="#" />

    Hope it helps.

  4. swami12
    Member
    Posted 3 years ago #

    I am having the same trouble, and neither method above seems to be working. Things are fine on my Home page, but other pages are not displaying images that use the anchor tag.

    The images have been inserted into header.php and sidebar.php using either the php code ?php bloginfo('template_directory') ?>/path_to_image_folder/image.extension or the path <img src="wp-content/themes/themename/images/1.jpg" alt="#" /> , but no luck either way.

    Also testing locally. Images set as backgrounds for divs in CSS work fine, too.

    Mysterious!

    Help appreciated..... thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic