• 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

Generate Pro – Featured image next to the entry content?

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 › Design Tips and Tricks › Generate Pro – Featured image next to the entry content?

This topic is: resolved

Tagged: css, featured image, generate

  • This topic has 2 replies, 2 voices, and was last updated 7 years, 6 months ago by joe555.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • September 12, 2015 at 12:15 pm #165303
    joe555
    Member

    How can I move the content (of the post excerpt) to be right next to the image?

    Here is the code that needs to be edited:

    //* Add featured image above the entry content
    add_action( 'genesis_entry_content', 'generate_featured_photo', 8 );
    function generate_featured_photo() {
    	if ( is_page() || ! genesis_get_option( 'content_archive_thumbnail' ) )
    		return;
    
    	if ( $image = genesis_get_image( array( 'format' => 'url', 'size' => genesis_get_option( 'image_size' ) ) ) ) {
    		printf( '<div class="featured-image"><img src="%s" alt="%s" class="entry-image"/></div>', $image, the_title_attribute( 'echo=0' ) );
    	}
    }

    Here is the image of what I am trying to accomplish:

    im

    Thanks!

    September 12, 2015 at 1:12 pm #165304
    Tom
    Participant

    This is achieved with CSS, not PHP.

    In your child theme stylesheet (after making a backup),

    1. Find this code at/around line 1246:

    .entry-content .entry-image {
    	margin: 0 40px 40px -60px;
    	max-width: 700px;
    }

    Replace it with this:

    .entry-content .entry-image {
        margin: 0 40px 0px -60px;
        max-width: 150px;
        float: left;
    }

    (This assumes you've changed the featured image setting in "Genesis > Themes Settings > Content Archives" to 150px.)

    2. In the media query for 768px (@media only screen and (max-width: 768px)), add this snippet before the closing "}" bracket:

    	.entry-content .entry-image {
        	margin: 0 40px 0px 0px;
        	}

    Choose your next site design from over 350 Genesis themes.
    [ Follow me: Twitter ] [ Follow Themes: Twitter ] [ My Favourite Webhost ]

    September 12, 2015 at 1:42 pm #165305
    joe555
    Member

    It works, thank you so much Tom!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and 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