• 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 multiple custom fields with the same name

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 › Displaying multiple custom fields with the same name

This topic is: not resolved

Tagged: custom-fields prose

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 4 months ago by fncll.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • November 16, 2017 at 4:02 pm #213653
    fncll
    Member

    I am using this custom code with Genesis and the Prose theme to display a custom field:

    add_action('genesis_after_post_content', 'post_add_bio', 1); 
    function post_add_bio() {
    if (is_single()) {
    if (genesis_get_custom_field('metanote')) {
    echo '<div class="authorinfo"><hr /><p>' . genesis_get_custom_field('metanote') . '<br /><br />' . genesis_get_custom_field('authorbio') . '</p></div>';
    }
    else {
    echo '<div class="authorinfo"><hr /><p>' . genesis_get_custom_field('authorbio') . '</p></div>';
    }
    }
    } 

    It works as expected. However, now I need to display multiple author names which are stored as multiple custom fields, each with the same title. Does anyone have sample/working code that does this?

    November 18, 2017 at 5:15 am #213703
    Victor Font
    Moderator

    No sample working code, but the process requires custom SQL to pull back all of the records. Once you retrieved them, you have to loop through the result set to format and display them. You may want to take a look at this: http://www.wpbeginner.com/plugins/allow-multiple-authors-to-be-associated-with-a-post-in-wordpress/. It may make things easier for you.


    Regards,

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

    November 18, 2017 at 2:56 pm #213718
    fncll
    Member

    Thanks. And...bummer. I was really hoping there would be some straightforward way to get the custom fields---they are all attached to the same post---into an array...it seems like this should be a relatively common need, same name or not!

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