• 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

Display content at top of post inside genesis 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 › Display content at top of post inside genesis entry content

This topic is: resolved

Tagged: genesis_entry_content

  • This topic has 9 replies, 3 voices, and was last updated 9 years, 1 month ago by photoaddictsa.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • June 15, 2017 at 5:54 am #207773
    photoaddictsa
    Member

    Ok, as the title suggests I want to display inserted content at the top of my post content.

    I add the content in the hook: genesis_entry_content but it sits at the bottom of the post, how do I get it to sit at the top of the post content?

    For an example of what I'm trying to achieve see http://inthebunch.co.za/2017/06/test-post-dont-edit-or-delete/ it's the overlapping content at the top right.

    June 15, 2017 at 6:16 am #207774
    Victor Font
    Moderator

    Change the priority of the hook. Assuming everything in your theme is using the Genesis defaults, genesis_entry_content displays the post content with the default priority of 10. If you change your hook to priority 9, it will display before the post content. For an example, the adjusted priority will look like:

    add_action( 'genesis_entry_content', 'my_custom_content', 9 );


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    June 15, 2017 at 7:07 am #207783
    photoaddictsa
    Member

    ahh ok,

    That makes perfect sense.

    ok one more question, can I just change the priority?

    The reason I'm asking is I am using Genesis simple hooks and inserted the content there? If not then I will re-write my code as you explained.

    June 15, 2017 at 7:34 am #207788
    Victor Font
    Moderator

    Genesis Simple Hooks executes its hooks at priority 10. You can't change the priority in the plugin. You have to move your code to functions.php.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    June 15, 2017 at 7:36 am #207789
    photoaddictsa
    Member

    I thought as much but had to take a chance 🙂

    Thanks for all your help, much appreciated.

    June 19, 2017 at 6:39 am #207930
    photoaddictsa
    Member

    I had to re-open this one.

    Victor, the solution you gave me worked but with a twist.

    I'm currently using this code: add_action( 'genesis_entry_content', include( get_stylesheet_directory() . '/yarpp-template-list.php'), 9);

    Problem is that when I do that, the info jumps completely out and sits in the top left corner of the browser. See:

    test

    Here is the code of the php file I'm including:

    <div class="yarppinline">
    <h3>Related Posts</h3>
    
    <?php if (have_posts()):
    	$postsArray = array();
    	while (have_posts()) : the_post();
    		$postsArray[] = '<a href="'.get_permalink().'" rel="bookmark">'.get_the_title().'</a><!-- ('.get_the_score().')-->';
    	endwhile;
    
    echo implode(', '."\n",$postsArray); // print out a list of the related items, separated by commas
    
    else:?>
    
    <p>No related posts.</p>
    <?php endif; ?>
    </div>

    Am I doing something wrong?

    June 20, 2017 at 12:36 am #207965
    Brad Dalton
    Participant

    Why don't you hook in a new widget area before the content and use the Yarpp widget.


    Tutorials for StudioPress Themes.

    June 20, 2017 at 12:52 am #207966
    photoaddictsa
    Member

    oohh, yea, that's also a great, idea.

    In that case (after registering the widget area) my code would look like this?

    add_action( 'genesis_entry_content', 'add_genesis_widget_area', 9 );
    function add_genesis_widget_area() {
                    genesis_widget_area( 'custom-widget', array(
    		'before' => '<div class="custom-widget widget-area">',
    		'after'  => '</div>',
        ) );
    
    }
    June 20, 2017 at 1:00 am #207967
    Brad Dalton
    Participant

    Yes but you need to add a conditional tag for single posts

    add_action( 'genesis_entry_content', 'add_genesis_widget_area', 9 );
    function add_genesis_widget_area() {
    if ( is_singular('post') ) {
                    genesis_widget_area( 'custom-widget', array(
    		'before' => '<div class="custom-widget widget-area">',
    		'after'  => '</div>',
        ) );
        }
    }
    

    And the code to register the widget.


    Tutorials for StudioPress Themes.

    June 20, 2017 at 1:05 am #207968
    photoaddictsa
    Member

    Awesome!!

    Thanks very much Brad. Will be subscribing to your site, loads I can learn there.

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 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

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