WordPress.org

Ready to get started?Download WordPress

Forums

How To Add Code To Post Template for an Image (4 posts)

  1. Altstatten
    Member
    Posted 8 years ago #

    What I want to do is add an image to the post file template so that every post contains the image in the same place, and the text wraps in the same way, everytime.

    I've already accomplished this manually but I'd like to place that code in the post template, but I can't seem to get it to fly.

    There's probably a plugin but it just seems to me that placing the code in the template would be even simpler.?? How-to, please.

  2. CharlesKrause
    Member
    Posted 8 years ago #

    You want to put the same image, in the same place, with the same formatting, in EACH post?

    Just add the code in the single.php file. If the image is to be a logo, or at the top of the page, it can go just before the content retrieval in the single.php file.

    I guess I'm assuming that you're "floating" the image though.

    Can you give more details as to placement/formatting/purpose of the image?

  3. Altstatten
    Member
    Posted 8 years ago #

    Image goes upper left, like a columnist's picture, which is what I'm doing.

    Again, I actually have all the html code to do it and I can insert it in each post one-at-a-time but I want to put itin the template so I don't have to bother each time.

  4. CharlesKrause
    Member
    Posted 8 years ago #

    exactly - so the code doesn't have to go into every post.

    Put it in the single.php file in the theme folder. Edit that html code and it shows up in each post.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags