• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Discussion
  • Design Tips
  • Showcase/Feedback
  • 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

Modern Portfolio: How to add featured image above post title

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 › General Discussion › Modern Portfolio: How to add featured image above post title

This topic is: resolved

Tagged: featured image

This topic contains 2 replies, has 2 voices, and was last updated by  Tom 7 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 23, 2013 at 1:47 pm #58487

    alexshenkar
    Member

    Hi Guys,

    I'm using the Modern Portfolio theme.

    You can see how he post page appears at this link:

    http://iskconme.staging.wpengine.com/test-post/

    I would like to add a featured image above the post title but below the breadcrumbs.

    Here is an example of the concept I'm going for: http://torquemag.io/whos-in/

    I've found some code snippets out there, but they seemingly haven't had any effect:


    remove_action( 'genesis_post_content', 'genesis_do_post_image' );
    add_action( 'genesis_before_post_title', 'genesis_do_post_image' );

    And I've also tried this:


    add_action( 'genesis_before_post_content', 'generate_post_image', 5 );
    function generate_post_image() {

    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( '%s', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
    }

    }

    How can I make this happen? Seems like it ought not be too difficult.

    I appreciate anyone's input. Thank you! -Alexander

    http://iskconme.staging.wpengine.com/test-post/
    August 23, 2013 at 7:00 pm #58552

    alexshenkar
    Member

    I was able to figure it out myself.

    I used this plugin to call on the featured image using a shortcode:

    http://wordpress.org/plugins/add-post-thumbnail-shortcode/

    And then I used the genesis simple hooks plugin to insert the featured image shortcode above the title:

    http://wordpress.org/plugins/genesis-simple-hooks/

    All good.

    Closing!

    August 23, 2013 at 7:54 pm #58557

    Tom
    Member

    Great that you found a solution. I was intrigued by the question and found this Genesis solution for functions.php from Vivek at wpstuffs.com.

    /* Code to Display Featured Image on top of the post */
    add_action( 'genesis_before_post', 'featured_post_image', 8 );
    function featured_post_image() {
      if ( ! is_singular( 'post' ) )  return;
    	the_post_thumbnail('post-image');
    }

    He has also posted an HTML5 version and some additional notes.


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

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Modern Portfolio: How to add featured image above post title’ 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

© 2021 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