• 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

Understanding Genesis Functions (Help)

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 › Understanding Genesis Functions (Help)

This topic is: not resolved
  • This topic has 7 replies, 2 voices, and was last updated 11 years, 8 months ago by nutsandbolts.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • November 8, 2013 at 7:37 am #71659
    Joseph Lee
    Member

    So it's easy to find the hooks. I still don't know how to find the functions. If I want to remove an H1 from a template file, how do I do that?

    I know genesis_before_header executes before the header. So if I want to remove the entire header div, for example, how do I know how to do that? What is the function called that prints out the header? Sometimes I see snippets that remove do_something from genesis, but I don't know where the author of the snippet found that the function existed.

    November 8, 2013 at 12:32 pm #71726
    nutsandbolts
    Member

    For your example of removing the header div, are you wanting to remove the entire header from the whole site? It may be easier to do that with CSS - you can do #header { display: none; } on XHTML themes or #site-header { display: none; } on newer HTML5 themes.

    Many of the functions are contained in the Genesis framework files - those files should never ever be edited, but you can use your child theme's functions.php to remove the things that are called in the framework. Hopefully that makes sense.

    Most of the time, you can save the time of searching through the framework and just search online for the function you need, but I understand that may not always be possible if you're wanting to do something that isn't commonly done.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    November 8, 2013 at 1:15 pm #71739
    Joseph Lee
    Member

    I wanted to remove the header in php, not in css. Css still causes it to be loaded then hidden. I don't like imagining that everytime I want to remove something on genesis I have to display none it. It's tasking to client browsers. Not that it's a huge task, it's just not right. I could achieve this on server side, if genesis documented the actions better.

    I see all of the hooks. I just don't see the actions documented. So it's not easy to know what to remove.

    November 8, 2013 at 1:17 pm #71741
    nutsandbolts
    Member

    I'm not saying you have to use CSS; I was just suggesting that as something that might be easier to implement depending on whether you wanted to remove it sitewide or just on certain pages/posts. To be honest, I've never seen anyone remove the entire site header, so I thought I misunderstood.

    To remove the header with a function, just add the following to functions.php:

    // Remove Header
    remove_action( 'genesis_header', 'genesis_do_header' );

    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    November 8, 2013 at 1:20 pm #71746
    Joseph Lee
    Member

    Where did you find genesis_do_header.

    Can genesis remove any div with a function? I don't understand how the framework assembles the page. I add actions to hooks easily enough. Though I don't know where the documentation is for all of the functions that print out the structure of the page.

    Thanks for helping thus far NutsandBolts.

    November 8, 2013 at 1:22 pm #71747
    nutsandbolts
    Member

    In the Genesis framework files, here is header.php:

    <?php
    /**
     * Genesis Framework.
     *
     * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
     * Please do all modifications in the form of a child theme.
     *
     * @package Genesis\Templates
     * @author  StudioPress
     * @license GPL-2.0+
     * @link    http://my.studiopress.com/themes/genesis/
     */
    
    do_action( 'genesis_doctype' );
    do_action( 'genesis_title' );
    do_action( 'genesis_meta' );
    
    wp_head(); //* we need this for plugins
    ?>
    </head>
    <?php
    genesis_markup( array(
    	'html5'   => '<body %s>',
    	'xhtml'   => sprintf( '<body class="%s">', implode( ' ', get_body_class() ) ),
    	'context' => 'body',
    ) );
    do_action( 'genesis_before' );
    
    genesis_markup( array(
    	'html5'   => '<div %s>',
    	'xhtml'   => '<div id="wrap">',
    	'context' => 'site-container',
    ) );
    
    do_action( 'genesis_before_header' );
    do_action( 'genesis_header' );
    do_action( 'genesis_after_header' );
    
    genesis_markup( array(
    	'html5'   => '<div %s>',
    	'xhtml'   => '<div id="inner">',
    	'context' => 'site-inner',
    ) );
    genesis_structural_wrap( 'site-inner' );
    

    So that shows you every action acting on the header, and you can modify or remove them in your functions.php depending on what you need the site to do.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    November 8, 2013 at 1:30 pm #71752
    Joseph Lee
    Member

    I see. So if that is the header.php where would I find the function do_action('genesis_header');

    I am trying to use either genesis or woothemes. Woothemes is more traditional. You just copy the markup from page.php and make adjustments. Genesis requires a lot of knowledge of genesis, that they don't really bother to document/tutorial.

    I like your site btw.

    November 8, 2013 at 1:35 pm #71754
    nutsandbolts
    Member

    That function is toward the end of header.php -

    do_action( 'genesis_before_header' );
    do_action( 'genesis_header' );
    do_action( 'genesis_after_header' );

    So if you want to remove the header, you just remove the action via functions.php to counteract what's in header.php.

    Most of the time, it's easier to just google things like "genesis how to remove header" and benefit from the knowledge of others in the community - no need to reinvent the wheel.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

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