Jump to content
Sign in to follow this  
MLaMaison

How to I get featured image on a single post

Recommended Posts

MLaMaison

Our blog currently displays the featured image as a thumbnail on the blog article list page. I would like to add that same image on single post page automatically, without have to manually at the image in the WP Editor. I'm kind of a WordPress Newbie. I have: PlatformPro Theme Framework PlatformPro Base Child Theme I currently have these pages in my child theme directory /platformbase/template.content.php /platformbase/template.postloop.php

Share this post


Link to post
Share on other sites
kastelic
Paste this code in platformbase/functions.php [code] add_action('pagelines_loop_before_post_content','featImg'); function featImg(){ the_post_thumbnail('medium'); } [/code] Look up the_post_thumbnail() in the WP codex for info on sizes and options.

Share this post


Link to post
Share on other sites
MLaMaison
Thanks Kastelic, that's kind of what I had already done. But I'm finding the image that is not actually in the post content is not being picked up via the RSS feed. Is there a way to get it in the content with out actually adding it via the EP editor. The same top placement would be fine, just somehow inside the post content rather than above it.

Share this post


Link to post
Share on other sites
Rob
Wordpress RSS feeds normally do not pick up images. That requires customization in the functions.php file. Are you able to go to a single post and add a feature image? If so, how are you doing it? If not, what happens when you try to do so?

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
MLaMaison
That's funny the images that we add in the body, show up in RSS feed, at least with the readers I have tested. Yea, we can add the featured image in the post editor just fine. The think is we imported many old blog articles from our old system that did not have images in the body. I was just was thinking that we could potentially add the featured image in both places with doing in manually. I'm sure I have seen themes that automatically add the associated featured image on the blog list page as a thumbnail, and at the same time add it to the single post page as larger image.

Share this post


Link to post
Share on other sites
kastelic
I think the closest one is going to be pagelines_loop_post_start which is inside the post above the title. You could move it around with jQuery if you need to, let me know if you want to do that.

Share this post


Link to post
Share on other sites
MLaMaison
It looks like I'm going to need to add the image via the WP editor, as I what them to be grabbed when and article is shared, etc. Thanks so much for your help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×