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 1 year ago.

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

    jbculp
    Participant
    Post count: 119

    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.

    #49442

    Anita
    Participant
    Post count: 7340

    Note: Backup your Functions.php file before doing this.

    Go to Functions.php and look for this – delete it:

    [php]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( ‘%s‘, get_permalink(), the_title_attribute( ‘echo=0′ ), $img );

    }
    [/php]

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


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

    #57277

    manapress
    Participant
    Post count: 2

    Instead of removing the code you can edit this:

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

    To me it worked.

    #57417

    jbculp
    Participant
    Post count: 119

    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.

    jc

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

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