Support » Fixing WordPress » adding images to static pages

  • Resolved comlucom


    its been weeks and i cant find the answer: i’m adding images on a static page but all that shows up is the alt word. where am i supposed to put the images to be able to have them show up? ive tried everything i can think of, any help would be great – thanks in advance – rob

Viewing 5 replies - 1 through 5 (of 5 total)
  • comlucom


    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    Template Name: welcome
    <?php get_header(); ?>
    Here's my welcome page! 
    <img src="images/stars.gif" width="212" height="226" alt="stars">
    <?php get_footer(); ?>

    this is the code – why wont that work? – anyway thanks again



    Try entering it as

    <img src="<?php echo get_template_directory_uri();?>/images/stars.gif">

    It should automatically take the width and height of the image uploaded in the images folder.

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]



    thanks a lot – i’ll give that a shot tonight and let you know



    Solution is probably posted. But just to avoid possible confusion I’ll mention that get_template_directory_uri() is the path to your current active theme. So your images folder shown in your code must not be in your parent directory.

    Chances are you know this comlucom but I don’t like to assume anything when it comes to troubleshooting.

    If you still have problems. Try visiting the image directly and confirm the full path. Then paste that into your theme. If your theme is not going to be used anywhere else, it is fine.

    If get_template_directory_uri() works for you. You may still want to replace it with the full path created by get_template_directory_uri(). Less use of functions makes for a faster theme.



    holy crap – that worked rikardo85 – thanks so much – i cant believe how difficult that was to find – and thanks webtech too, i never wanted to be the guy posting questions but now i’m wondering why …

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘adding images to static pages’ is closed to new replies.