• 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

How Can I Display Genesis-Boxes using Custom Fields?

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 › How Can I Display Genesis-Boxes using Custom Fields?

This topic is: resolved

Tagged: box, custom field, Custom fields, genesis

  • This topic has 3 replies, 2 voices, and was last updated 12 years, 6 months ago by Jen Baumann.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • December 20, 2012 at 7:52 am #6387
    netbloger
    Member

    Hi, I run my website on Genesis Framework. I read tutorial about displaying genesis box here:
    http://www.briangardner.com/genesis-box/

    I did everything correctly.

    But now I want to know how can I display genesis-box using custom fields?

    Because I want to add more boxes on my genesis site like:

    listbuilding-box
    hosting-box
    membership-box
    etc.

    My question is How can I display genesis-box or other boxes depending on custom filed?

    Sample Scenario:

    Genesis box displayed on post only if custom field 'genesis' has value: 'true'

    Or something like that.

    Any kind of help would be appreciated.
    Thanks,
    Simon

    December 20, 2012 at 2:06 pm #6495
    Jen Baumann
    Participant

    This is totally untested code. I just did it real quick to give you an idea of what you might do.

    /** Add Genesis Box on Single Posts */
    add_action( 'genesis_after_post_content', 'include_genesis_box', 11 );
    function include_genesis_box() {
    if ( is_single() )
    $genesis_box = genesis_get_custom_field( 'box_select' );
    if ( $genesis_box == 'listbuilding-box') {
    require( CHILD_DIR.'/listbuilding-box.php' );
    }
    if ( $genesis_box == 'hosting-box') {
    require( CHILD_DIR.'/hosting-box.php' );
    }
    }

    December 21, 2012 at 7:23 am #6625
    netbloger
    Member

    It works like a charm!

    Thanks 😉

    December 21, 2012 at 8:19 pm #6842
    Jen Baumann
    Participant

    Phew! Great! You're welcome!

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How Can I Display Genesis-Boxes using Custom Fields?’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

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