WordPress.org

Ready to get started?Download WordPress

Forums

How do I add images to posts? (12 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    Hello
    How do I add images to posts and have them show up in the archive of said post?
    I currently just have it linked to my images folder but it is not there on the comments and other generated pages?
    Thanks
    Johnny

  2. Mark (podz)
    Support Maven
    Posted 10 years ago #

    You are probably using a relative url "img src="/images/bunny.jpg"
    You need to use a full url "img src="www.johnnygulag.com/images/bunny.jpg"

  3. Anonymous
    Unregistered
    Posted 10 years ago #

    Hello
    Thanks alot, It worked like a charm!
    Johnny

  4. Mark (podz)
    Support Maven
    Posted 10 years ago #

    Cool !!

  5. Anonymous
    Unregistered
    Posted 10 years ago #

    Hello

    Actually, you don't have to use full URI.
    Relative URI works great, given that you specify in the header of the index.php file the following line :
    <base href="http://www.yourdomain.com/"/>
    By the way, "url" does not exist yet, but "uri" does.

    Hey thanks for the advice, that will be used in the future I am sure.
    Johnny

  6. Mark (podz)
    Support Maven
    Posted 10 years ago #

    Strictly speaking, 'url' would be better described as extinct.

  7. Lorelle
    Member
    Posted 9 years ago #

    I"ve placed the code within the index.php as follows:

    <?php
    /* Don"t remove this line. */
    require("./wp-blog-header.php");
    ?>
    <base href="http://www.yourdomain.com/"/>
    <!DOCTYPE html PUBLIC "-//W3C//......

    Is this right?

  8. XeroCool
    Member
    Posted 9 years ago #

    No. http://www.yourdomain.com should be the link to your domain.

  9. Kitten
    Member
    Posted 9 years ago #

    Also, it should be below the DOCTYPE or your page won't validate.

  10. Lorelle
    Member
    Posted 9 years ago #

    Okay, so just below DOCTYPE and as written. Or would it have to be something like:

    <base href="http://www.yourdomain.com/wordpress/"/>

    if WordPress is installed in its own directory?

    We need to put this in the codex or wiki as people use photos all the time. Is it there? Or is this fixed in 1.5?

  11. Kitten
    Member
    Posted 9 years ago #

    It's all relative, literally.

    If your WP install is in wordpress/ and you do the base as above, then you can specify wp-content/image.jpg and have it work as it should. If you don't hang the wordpress/ on there, then you'll have to find your images as wordpress/wp-content/image.jpg

    Oh, and my mistake above, the base tag should be in the head section. Validation would point that out.

  12. Lorelle
    Member
    Posted 9 years ago #

    I have 1.2.2 running and it's easy to paste this into the index.php. But I also have 1.5 running and the index.php now works differently. Should it be in the index.php or the wp-blog-header.php?

    I assume the header because that is where the HEAD tag resides, but I want to make sure.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.