• 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

Is this PHP code OK with HTML5?

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 › Is this PHP code OK with HTML5?

This topic is: resolved

Tagged: custom widget, custom widgets, html5, magazine, minimum

  • This topic has 3 replies, 3 voices, and was last updated 10 years, 9 months ago by smartal.aundries.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • March 2, 2015 at 3:11 pm #142909
    eluviis
    Member

    Hi, this is code I was using for some custom widgets on my old Minimum (pre-HTML5 Minimum Pro). My site is now on Magazine-Pro.

    I want these widgets on my new Magazine Pro site but before I go and attempt to make them work, can any of you experts tell me if this code is even correct for use on a HTML5 child theme?

    Here's the code:

    /** Display custom content box 1 widget after the post content - Needs debugging */
    add_action( 'genesis_after_post_content', 'add_custom_content_box_1' );
    function add_custom_content_box_1() {
        if ( is_singular( array( 'post', 'quickblog', 'specialty', 'event' ) ) )
        genesis_widget_area( 'custom-content-box-1', array(
            'before' => '<div id="custom-content_box_1 widget-area">',
        ) );
    }
    
    /** Display custom content box 2 widget after the post content - Needs debugging */
    add_action( 'genesis_after_post_content', 'add_custom_content_box_2' );
    function add_custom_content_box_2() {
        if ( is_singular( array( 'post', 'quickblog', 'specialty', 'event' ) ) )
        genesis_widget_area( 'custom-content-box-2', array(
            'before' => '<div id="custom-content-box-2 widget-area">',
        ) );
    }
    
    March 2, 2015 at 4:05 pm #142927
    ᴅᴀᴠɪᴅ
    Member

    The hook 'genesis_after_post_content' doesn't exist in the new html5 child themes, it has been replaced with 'genesis_entry_footer'.

    You can see the hook changes here New HTML5 Hooks - WPSITES

    The other thing is, widget areas are usually written like this..

    genesis_widget_area( 'custom-content-box-2', array(
    		'before' => '<div class="custom-content-box-2 widget-area">',
    		'after'  => '</div>',
    ) );

    The only difference is closing the divs and using classes instead of id's for easier future management of CSS.


    I love helping creative entrepreneurs build epic things with WP & Genesis.

    Follow on Twitter

    March 2, 2015 at 5:44 pm #142947
    eluviis
    Member

    Thanks David, that makes sense. I'll keep that in mind. I think that armed with that I can get this to work. Cheers.

    March 3, 2015 at 12:12 am #142978
    smartal.aundries
    Member

    Thanks David this also Help me. 🙂

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

© 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