Community Forums › Forums › Archived Forums › General Discussion › Going Green Double Featured Image
Tagged: featured image, going greee
- This topic has 3 replies, 3 voices, and was last updated 11 years, 8 months ago by
jbculp.
-
AuthorPosts
-
July 4, 2013 at 11:20 am #49212
jbculp
ParticipantGoing Green or simply Going Crazy? (Sorry, couldn't resist). I'm a big picture guy and have trolled the site looking for an explanation of a feature but can't find the higher level design discussion. So, can someone explain to me the featured image logic of going green?
The standard featured image as seen in the theme demo spans the width of the post area. Good enough. There are times when that's fine for our simple blog, however there are also times when that's not so ideal (e.g. a vertical image).
Yesterday we added an image to a blog post NOT using the featured image utility on the right hand side in the WordPress post page. This post therefore did not have a designated "featured image". The expected result was a vertical image adjacent to the text that we could control the border and margins etc. and no big image across the top of the post. The problem is it replicated that image (really a cropped version of it) as the featured image. So we have a portion of our image spanning the post as the Featured Image and immediately below it, we have the image we wanted.
What I need to know is this:
1. What is the logic of this auto insert design? Under what conditions would I want this auto featured image?
2. How do I turn it off? Is it a setting or do I need to disable it in the php? I don't want to turn off Featured Images. If for some reason a post doesn't have a featured image, I simply don't want the first image I insert into the post to become replicated as a featured image.Thanks anyone for helping me understand this feature and how to turn it off. I'm happy to learn of a link to an article or blog post explaining it, I simply couldn't find it.
July 5, 2013 at 5:49 pm #49442AnitaC
KeymasterNote: Backup your Functions.php file before doing this.
Go to Functions.php and look for this - delete it:
add_action( 'genesis_post_content', 'goinggreen_post_image_single', 5 ); /** * Add featured image to single posts */ function goinggreen_post_image_single() { if ( ! is_singular( 'post' ) ) return; $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) ); printf( '<a href=""%s"" title=""%s"">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img ); }
That's what controls the automatic placement of the images across the top.
Need help with customization or troubleshooting? Reach out to me.
August 19, 2013 at 5:56 am #57277manapress
ParticipantInstead of removing the code you can edit this:
if ( ! is_singular( 'post' ) ) <---- for this ----> if ( ! is_singular( 'none' ) )
To me it worked.
August 19, 2013 at 2:56 pm #57417jbculp
ParticipantThanks all... I had been holding off on anitac's solution, waiting for a moment when I could look at the code and think about it. manapress' solution was naturally more simple even they both addressed the same block of code. I made the change = post to none and left myself comments in the functions.php file so I could know what I did later. It worked wonderfully on a simple test of creating a new post, inserting an image and NOT making a featured image. When published the post did not auto-convert the image to featured. That's good. I'm going to call this resolved and thank both of you for your help.
jc
-
AuthorPosts
- The topic ‘Going Green Double Featured Image’ is closed to new replies.