Modern Portfolio: How to add featured image above post title

Community Forums Forums General Discussion Modern Portfolio: How to add featured image above post title

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  Tom 1 year, 2 months ago.

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

    alexshenkar
    Participant
    Post count: 7

    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/
    #58552

    alexshenkar
    Participant
    Post count: 7

    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!

    #58557

    Tom
    Participant
    Post count: 945

    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.
    Updates via GenesisThemes.ca | Twitter | Google+ | Tumblr

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.