WordPress.org

Ready to get started?Download WordPress

Forums

How?: Add an image at the end of each post (8 posts)

  1. drdarrow
    Member
    Posted 8 years ago #

    I used to have a blogger account and it was easy to change the ONE template... so I don;t know where to look for what I want to do.

    I want to add a single, small image <img src="images/black.gif" width="4" height="4"> that will appear about two ems after the very last word or punctuation mark of each blog entry, on the same line, without having to enter an image tag in my actual posting every time. I just want it to "be there" when I view my site.

    Where would I enter such code so that it is included as I have described?

  2. moshu
    Member
    Posted 8 years ago #

    Probably in the index.php template - just after the_content tag. Give it a class and style it in the CSS file.

  3. edelen
    Member
    Posted 8 years ago #

    I tried this technique and all it did was hang my site. I don't know PHP. My example:

    <p class="centeredImage"><img src="http://zzz.com/images/badge.png" border="0" height="15" width="80"></p>

    That call works elsewhere in the site, but I suspect there's some PHP code that has to go around this. What?

    From the index.php from the theme I'm using:


    // single page
    // -----------
    if( !is_single() ) {

    if ( $usePassword ) { echo "<div class=\"passwordPost\">"; }

    if ( $pageDisplay == 0 ) {
    the_content();
    } else {
    the_excerpt();
    }

    if ( $usePassword ) { echo "</div>"; }

    } else {

    if ( $usePassword ) { echo "<div class=\"passwordPost\">"; }

    the_content();

    if ( $usePassword ) { echo "</div>"; }
    }

    wp_link_pages();

    echo "<!--";
    trackback_rdf();
    echo "-->";

    if( is_single() ) {

    comments_template();

    }

    endwhile; else: ?>

    Clueless...

    Thanks in advance!

  4. edelen
    Member
    Posted 8 years ago #


  5. moshu
    Member
    Posted 8 years ago #

    Strange code you have there... which theme?
    And where did you put your "example"?
    Link?
    (please, don't post your whole index here - if you need to post long code, use a pastebin service, like http://paste.uni.cc)

  6. halfbloodprince
    Member
    Posted 8 years ago #

    There is a plugin to do exactly this. Unfortunately, the site seems to be down at the moment. Maybe you can check again in a while?

  7. moshu
    Member
    Posted 8 years ago #

    There is another plugin, too:
    http://guff.szub.net/2006/02/09/post-image/

  8. edelen
    Member
    Posted 8 years ago #

    Moshu,

    The theme is a fairly popular one, Regulus 2.1.

    Didn't matter which "the_content()" I put it in after. I got a blank screen when I tried to reload the site.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags