• 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

Adding custom field info to posts

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 › Adding custom field info to posts

This topic is: not resolved

Tagged: "custom fields" hooks prose

  • This topic has 5 replies, 2 voices, and was last updated 10 years, 7 months ago by Brad Dalton.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • July 17, 2015 at 5:50 pm #159690
    fncll
    Member

    I have some information in custom fields for posts that I want to display.

    The first thing I want to do is have the contents of a custom field display after the title of a post.

    The second is that I want to use a few custom fields in a div before the post meta information.

    How do I access custom field info using Genesis hooks?

    I'm using the Prose (child) theme, but I think the basic approach is likely the same no matter what theme?

    July 17, 2015 at 7:35 pm #159693
    Brad Dalton
    Participant

    Try this http://wpsites.net/web-design/how-to-create-a-custom-field/

    And use the 3rd parameter to position the custom fields with the genesis_entry_header hook


    Tutorials for StudioPress Themes.

    July 17, 2015 at 7:43 pm #159694
    fncll
    Member

    I've made progress...however, I have to use the XHTML hooks because enabling HTML5 with the Prose theme is causing all kinds of breakage even if I remove all of my custom code and rules.

    I'm now able to add custom fields and did so using genesis_after_post_title

    However, how can I add content after the body of the post but before the meta information (categories, tags, etc)? The genesis_after_post hook is closest but it's still below that meta information...

    July 17, 2015 at 7:56 pm #159695
    Brad Dalton
    Participant

    Try adding a 3rd parameter to your hook or use the_content hook which executes immediately after the content.


    Tutorials for StudioPress Themes.

    July 17, 2015 at 8:03 pm #159696
    fncll
    Member

    I tried using a 3rd parameter of 0, 1, 10, 100 -- it moved the content up and down but only below the meta information.

    So I tried using the_content but it clobbered my content rather than adding right after it...how do I not do that? This is my simple code right now:

    add_action('the_content', 'post_add_bio'); 
    function post_add_bio() {
    if (is_single()) {
    echo '<p>' . genesis_get_custom_field('authorbio') . '</p>';
    }
    }
    July 17, 2015 at 10:34 pm #159699
    Brad Dalton
    Participant
    the_content

    is a filter hook not an action hook so you need to use it differently.
    Example:

    add_filter('the_content', 'your_function'); 
    function your_function( $content ) {
    // Your Code
    

    You also need to

    return $content;

    when using a filter hook rather than use echo.


    Tutorials for StudioPress Themes.

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