• 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

Displaying post featured image before the 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 › Archived Forums › General Discussion › Displaying post featured image before the title

This topic is: resolved

Tagged: genesis_before_post_title, hooks

  • This topic has 4 replies, 3 voices, and was last updated 10 years, 2 months ago by blustemy.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • September 27, 2013 at 6:34 am #64451
    blustemy
    Member

    Hi,

    I would like to know how to display the featured image of a post just before its title, for every post.

    Actually I’ve tried something as simple as this, just displaying a static text instead of the image, in the file functions.php of my child theme:

    add_action( 'genesis_before_post_title', 'insert_test' );
    function insert_test() {
    	?>
    		<h1>test</h1>
    	<?php
    }

    But nothing appears! I’m a bit lost…

    If anyone has clues on this issue that would be great.

    Thanks a lot.

    September 27, 2013 at 9:37 am #64466
    Susan
    Moderator

    Try this code snippet from:

    http://wpspeak.com/customize-featured-image/

    // Move image above post title in Genesis Framework
    remove_action( 'genesis_post_content', 'genesis_do_post_image' );
    add_action( 'genesis_before_post_title', 'genesis_do_post_image' );
    
    September 27, 2013 at 10:37 am #64472
    blustemy
    Member

    In fact it seems the hook add_action( 'genesis_before_post_title', 'insert_test' ); works only when I remove HTML5 support.

    So, I’ve found a fix:

    add_action( 'genesis_entry_header', 'insert_test', 1 );
    function insert_test() {
    	?>
    		<!-- I’ll put the code to display the featured image here -->
    	<?php
    }

    I haven’t found any official documentation on this. Only Googling…

    Anyway, thanks a lot for your help.

    September 27, 2013 at 6:19 pm #64536
    Brad Dalton
    Participant

    That's right, the hooks have changed http://genesistutorials.com/visual-hook-guide/


    Tutorials for StudioPress Themes.

    October 4, 2013 at 9:40 am #65356
    blustemy
    Member

    Thanks a lot, this visual hook guide is awesome. It really helped me understand all the available hooks!

    It resolved my initial issue 🙂

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ 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