WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] image template tag? (5 posts)

  1. steveo1
    Member
    Posted 7 years ago #

    The design I am building to requires an image to accompany the title of each post.

    Is there a template tag which I can use to reference an image uploaded with a post?

  2. steveo1
    Member
    Posted 7 years ago #

    Sorry, I'll attempt to phrase that better.

    We have the_title() and the_content() template tags, is there a method or plugin to have a "the_attachment()" or "the_image()" tag?

    I need some way of referencing an uploaded image for each post and dropping the path into an <img> tag.

  3. phaticon
    Member
    Posted 7 years ago #

    So from what I understand you want a image specified with each post from one that you uploaded. If thats the case then you can use the plugin Post Image, and it's simple to get it working. Just download the plugin, activate it, open your template file where you want the image placed, add the plugin code into the template, and now it should work. You have to make a css class for this image as well which if specified in the plugin itself. All you have to do is upload a image and that image shows up on that post. Remember though that the first image uploaded becomes the image thats displayed within your template, if that make any sense.

  4. steveo1
    Member
    Posted 7 years ago #

    That's EXACTLY what I need. Thanks dude, much appreciated.

  5. phaticon
    Member
    Posted 7 years ago #

    You're welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags