• 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

Best Practice on these two options.

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 › General Discussion › Best Practice on these two options.

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 10 years, 3 months ago by Dezigna.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • January 19, 2015 at 7:03 pm #137998
    Dezigna
    Member

    Hi Team,
    When adding html to a hook is there a best method or practice between the the two examples below? ie. closing the php prior to the html and then starting again after, or just using the echo method in the second example. Both methods seem to work OK. Just starting out with Genesis and I want to do it right from the get go.

    Thanks for your advice

    //* Add Upper Header
    add_action('genesis_before_header', 'add_upper_hdr');
    function add_upper_hdr() { ?>
    <div class="upper-header"></div>
        <?php
    }
    //* Add Upper Header
    add_action('genesis_before_header', 'add_upper_hdr');
    function add_upper_hdr() {
    	 echo'<div class="upper-header"></div>';
    };
    January 20, 2015 at 7:29 am #138030
    Davinder Singh Kainth
    Member

    I generally use the 2nd one (so does majority of Studiopress official themes while adding new widget area + class)


    Sunshine PRO genesis theme
    Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis Themes

    January 21, 2015 at 8:48 pm #138235
    Dezigna
    Member

    Thankyou Davinder,
    That's just what I needed to know.
    Cheers.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ 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

© 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