• 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

Move page title, add custom field

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 › Move page title, add custom field

This topic is: resolved

Tagged: actions, Custom fields, hooks

  • This topic has 7 replies, 3 voices, and was last updated 12 years, 5 months ago by river-bum.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • April 9, 2014 at 8:46 am #99343
    river-bum
    Member

    Hello -
    I'm trying to move my page title and insert a custom field underneath it, but I can't get the custom field to show up. Here's the code I have:

    add_action( 'genesis_before', 'move_title' );
    function move_title () {
    remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    add_action( 'genesis_before_content', 'genesis_do_post_title', 0 );
    }
    
    add_action( 'genesis_after_post_title', 'bench_location' );
    function bench_location () {
    genesis_custom_field( 'bench-location' );
    }

    The title gets moved above the sidebar content and page content, but 'bench_location' will not appear. When I use another hook, such as 'genesis_before_entry_content', it works.

    Hope someone can help. Thank you in advance!

    http://www.gregseitz.com/artbenchtrail/?page_id=11
    April 9, 2014 at 11:35 pm #99443
    essaysnark
    Participant

    So, crazy question: Have you enabled HTML 5 support in your theme?

    April 10, 2014 at 7:24 am #99477
    Brad Dalton
    Participant

    You're using both XHTML and HTML 5 loop hooks. http://my.studiopress.com/docs/genesis-loop-hooks-comparison/

    genesis_entry_header
    genesis_after_post_title
    

    This works

    add_action( 'genesis_entry_header', 'bench_location' );
    function bench_location () {
    genesis_custom_field( 'bench-location' );
    }
    

    Use the 3rd parameter for positioning priority if you want to change the output below the post info

    add_action( 'genesis_entry_header', 'bench_location', 12 );
    function bench_location () {
    genesis_custom_field( 'bench-location' );
    }
    

    Tutorials for StudioPress Themes.

    April 10, 2014 at 7:54 am #99484
    river-bum
    Member

    Thank you! Did I mention I'm new to this?

    I realized I was approaching it a bit sideways, and figured out rather than trying to position it after the post title, which I was moving, I could also just put the custom field above the content, too.

    Does this code make sense?

    add_action( 'genesis_before', 'move_title' );
    function move_title () {
    	remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    	add_action( 'genesis_before_content', 'genesis_do_post_title', 0 );
    }
    
    add_action( 'genesis_before_content', 'custom_field_before_content', 15 );
    function custom_field_before_content() {
    	echo '<div class="after-title">'. genesis_get_custom_field('bench-location') .'</div>';
    }

    Thanks again. (By the way, yes, I have HTML5 enabled, but had a feeling I was doing something wrong by using an XHTML hook...)

    April 10, 2014 at 8:14 am #99489
    Brad Dalton
    Participant

    Looks ok to me.

    How did it test?


    Tutorials for StudioPress Themes.

    April 10, 2014 at 8:15 am #99490
    river-bum
    Member

    It works!

    April 10, 2014 at 8:15 am #99491
    Brad Dalton
    Participant

    Looks ok to me.

    How did it test?

    You did a good job for being new!


    Tutorials for StudioPress Themes.

    April 10, 2014 at 8:31 am #99496
    river-bum
    Member

    Thanks! Sure took me a while and some frustration to figure it out. Really appreciate your help (and I've now subscribed to WP Sites).

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