• 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

Viewing 11 replies - 1 through 11 (of 11 total)
  • 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”

    Thread Starter 4089

    Hello
    Thanks alot, It worked like a charm!
    Johnny

    Cool !!

    Thread Starter 4089

    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=”https://www.yourdomain.com/”/&gt;
    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

    Strictly speaking, ‘url’ would be better described as extinct.

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

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

    Is this right?

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

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

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

    <base href="https://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?

    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.

    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.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How do I add images to posts?’ is closed to new replies.