• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Unwanted Featured Images appearing in Smart Passive Income Theme Pages

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Unwanted Featured Images appearing in Smart Passive Income Theme Pages

This topic is: resolved

Tagged: featured images, Smart Passive Income

  • This topic has 5 replies, 3 voices, and was last updated 6 years, 10 months ago by MR.NAME.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • September 23, 2016 at 2:20 pm #193614
    MR.NAME
    Member

    Hello, I am using Smart Passive Income theme with featured images turned on. The problem is that When I have the page / post featured images setting turned on it is adding a featured image when I have an image in the body or it is showing a random image from my media library even when I don't have one assigned to the page.

    Here is an example of the double posted image. There is NO featured image assigned to this page, but it is taking my inline image and adding it as featured. Example: http://michaelslawrence.net/about/

    http://michaelslawrence.net/about/
    September 23, 2016 at 11:32 pm #193628
    Brad Dalton
    Participant

    Hi

    2 steps:

    1. Don't put an image at the beginning of the editor before you add text content.
    2. You can also remove or modify the code which starts on line 135 in your functions.php file.


    Tutorials for StudioPress Themes.

    September 23, 2016 at 11:49 pm #193629
    MR.NAME
    Member

    Thanks for the response! I moved the photo further down, with text above it, but it still displays an unwanted featured image. What exactly should I adjust in the code? I DO want to keep the ability to display featured images on all posts and pages WHEN I set them. In this case, it is setting even though I have not selected one. Here is the code section, beginning on line 135 of functions.php:

    //* Remove default Genesis featured image
    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
    add_action( 'genesis_entry_content', 'genesis_do_post_image', 1 );

    //* Add featured image to posts/pages
    add_action( 'genesis_entry_content', 'spi_do_featured_image', 1 );
    function spi_do_featured_image() {

    $show_image = get_theme_mod( 'spi_single_image_setting', true );

    $img = genesis_get_image( array(
    'format' => 'html',
    'size' => genesis_get_option( 'image_size' ),
    'context' => 'archive',
    'attr' => genesis_parse_attr( 'entry-image', array ( 'alt' => get_the_title() ) ),
    ) );

    if ( ! empty( $img ) && is_singular() && ( true === $show_image ) ) {
    echo $img;
    }

    }

    Any guidance as to the adjustments that would correct this is appreciated! Thanks again!

    November 9, 2016 at 7:13 pm #195966
    laurarabell
    Member

    I am having this same issue. Would like to have the ability to only display featured images when I actually set a featured image. Having this problem with multiple genesis themes.

    November 9, 2016 at 10:45 pm #195968
    Brad Dalton
    Participant

    Try this code


    Tutorials for StudioPress Themes.

    January 24, 2017 at 5:30 pm #199961
    MR.NAME
    Member

    The "Alternative method" you added to the post you linked to worked perfectly! Thanks so much!!

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Unwanted Featured Images appearing in Smart Passive Income Theme Pages’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble