WordPress.org

Ready to get started?Download WordPress

Forums

Posts in Page
[resolved] Include images in posts shown? (3 posts)

  1. meadwench
    Member
    Posted 1 year ago #

    OK, I put the template file in my theme directory and added code to show a 'read more...', but am not sure how to add code to show the first image in the post. Is that possible?

    I dug around in my theme code, and couldn't find anything that seemed to specifically call out post images.

    http://wordpress.org/extend/plugins/posts-in-page/

  2. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    Howdy meadwench,

    Since this plugin is usingthe_excerpt by default, it won't show images because the_excerpt strips formatting and images per the documentation:

    http://codex.wordpress.org/Function_Reference/the_excerpt

    I suppose you could modify the template file to use the_content instead along with some code to tailor exactly what is shown, but that could change presentation of content on the whole site and could become frustrating, depending on how ninja your PHP skills are.

    A better way to go would be to modify the template file to pull in the post's Featured Image (aka. Post Thumbnail):

    http://codex.wordpress.org/Post_Thumbnails

    Hope that helps,
    Eric

  3. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    Hey meadwench,

    Daniel and I discussed it and it could be that you could use the_content along with the more tag, but that would require you inserting a more tag in each post after the content and image you'd want to display.

    I think the easier, softer way is to go with Featured Image.

    Cheers,
    Eric

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.