Community Forums › Forums › Archived Forums › General Discussion › How To Get Featured Images to Display in Blog Post
Tagged: featured image, post
- This topic has 4 replies, 3 voices, and was last updated 10 years, 11 months ago by
Genesis Developer.
-
AuthorPosts
-
March 12, 2014 at 12:55 pm #94490
kristabradford
MemberHello All,
I haven't quite figured out how to get featured blog post images to display an individual blog post. I am currently using Parallax for one website and Civic for another.You can see the images just fine when you view them in a list of posts:
See http://tgsus.com/category/executive-moves/However, they disappear when you click into the individual posts. Any plugin or code snippet I ought to consider? I've tried somethings I've read here but haven't managed to get them to work . . .
Many thanks in advance,
Krista
Thank you!
Krista Bradford
CEO The Good Search | IntelleratiMarch 12, 2014 at 2:22 pm #94508AnitaC
KeymasterMarch 12, 2014 at 4:25 pm #94524kristabradford
MemberI just tried replacing genesis_entry_header with genesis_entry_content in the php code. It pushed the image all the way to the bottom of the post. So . . . hmmmm.
Thank you!
Krista Bradford
CEO The Good Search | IntelleratiMarch 15, 2014 at 6:22 am #94522kristabradford
MemberThank you for you kind post. Thanks to you, I've managed to make progress. (My apologies in advance. I am just now coming up to speed on Genesis as a concept.) I can get the featured image to appear after the title with the php code from the page you pointed me to as follows:
add_action( 'genesis_entry_header', 'single_post_featured_image', 15 );
function single_post_featured_image() {
if ( ! is_singular( 'post' ) )
return;$img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) );
printf( '%s', get_permalink(), the_title_attribute( 'echo=0' ), $img );}
I then tried some CSS code and and successfully got the image to align left:
.single .post-image {
float:left;
margin: 1em 1em 0 0;
width: 150px;
height: 150px;
}
}But its not wrapping . . . I basically want the featured image to appear as it done on the page with the list of posts. I'd like the image to be left aligned the text wrapping to the right.
http://tgsus.com/category/executive-moves/Totally guessing: is it that I need to have the php hook into a different section of the post -- genesis_entry_content ? Would i replace "genesis_entry_header" with "genesis_entry_content" in the php file?
(It is okay to laugh . . .)
Thank you!
Krista Bradford
CEO The Good Search | IntelleratiMarch 15, 2014 at 8:01 am #95009Genesis Developer
MemberTry this
$img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'alignleft post-image' ) ) );
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.