Going Green Double Featured Image

Community Forums Forums General Discussion Going Green Double Featured Image

This topic is: not resolved

This topic contains 3 replies, has 3 voices, and was last updated by  jbculp 2 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #49212


    Going 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.



    Note: 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’ ) )
    	$img = genesis_get_image( array( ‘format’ => ‘html’, ‘size’ => genesis_get_option( ‘image_size’ ), ‘attr’ => array( ‘class’ => ‘post-image’ ) ) );
    	printf( &#8216;<a href="&quot;%s&quot;" title="&quot;%s&quot;">%s</a>&#8216;, get_permalink(), the_title_attribute( &#8216;echo=0&#8242; ), $img );

    That’s what controls the automatic placement of the images across the top.



    Instead of removing the code you can edit this:

    if ( ! is_singular( ‘post’ ) ) <—- for this —-> if ( ! is_singular( ‘none’ ) )

    To me it worked.



    Thanks 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.


Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Going Green Double Featured Image’ is closed to new replies.