• 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

lib/init.php needed??

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 › lib/init.php needed??

This topic is: not resolved

Tagged: genesis resources, Sidebar

  • This topic has 6 replies, 4 voices, and was last updated 10 years, 2 months ago by Tom.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • August 17, 2014 at 12:55 pm #119385
    mmjaeger
    Member

    Hello

    is this line in a Genesis child theme needed: include_once( get_template_directory() . '/lib/init.php' );

    I'd like to put some of my functions into a setup function and use something like this:

    add_action( 'genesis_setup', 'child_theme_setup' );

    However, when I included lib/init.php at the top, the setup function is not executed?! Isn't lib/init.php executed anyway in the parent theme?

    Hope somebody can clarify.

    Thanks

    August 18, 2014 at 7:09 am #119515
    mmjaeger
    Member

    bump

    August 18, 2014 at 7:18 am #119516
    Ben @ Inbound Creative
    Member

    The StudioPress guys will have a much better way of explaining this, but from what I understand, that line calls the Genesis code before any of the child theme's code is executed.

    You might have more luck asking on Twitter with the hashtag #genesiswp.


    Award winning web design in Liverpool | UK based Genesis Framework web designer and developer

    August 18, 2014 at 8:18 am #119530
    Tom
    Participant

    @mmjaeger Here's how David Chu (@flamenco) adds a custom-function.php (and custom stylesheet)
    http://www.studiopress.community/topic/child-themes-and-updates/#post-108524


    Choose your next site design from over 350 Genesis themes.
    [ Follow me: Twitter ] [ Follow Themes: Twitter ] [ My Favourite Webhost ]

    August 18, 2014 at 8:23 am #119532
    mmjaeger
    Member

    I'm not so much worried how to organize my custom code, I'm wondering why 'genesis_setup' is not running when I include 'lib/init.php' at the top of my functions file?

    May 1, 2015 at 3:52 am #149701
    yogidev
    Member

    I would really like to know this as well.
    One of the reasons I went with Genesis is that I heard the support community was so strong!
    This seems like a pretty fundamental thing that should be documented somewhere?

    What I am actually trying to achieve (that apparently requires adding the lib/init.php line) is implementing sidebars for a blog section within a child theme that does not use sidebars elsewhere.

    Any pointers?

    May 1, 2015 at 2:35 pm #149747
    Tom
    Participant

    Hi @yogidev,

    Pointers:

    You're attempting to tag onto a thread that's almost a year old about a topic that *might* be related to something you're interested in. It's always better to start your own thread with your own specific question, about a specific child theme.

    Your child theme functions.php should have a section of statements that remove the sidebar(s); probably looks something like these:

    //* Unregister layout settings
    genesis_unregister_layout( 'content-sidebar' );
    genesis_unregister_layout( 'sidebar-content' );
    genesis_unregister_layout( 'content-sidebar-sidebar' );
    genesis_unregister_layout( 'sidebar-sidebar-content' );
    genesis_unregister_layout( 'sidebar-content-sidebar' );
    
    //* Unregister sidebars
    unregister_sidebar( 'sidebar' );
    unregister_sidebar( 'sidebar-alt' );

    Comment-out or delete the line for the sidebar you wish to add back.

    If you're trying to add a sidebar to a child theme. This is the resource fromStudioPress:
    How to Register a Widget Area
    http://my.studiopress.com/tutorials/register-widget-area/

    Google is also your friend for this and reveals many tips and tutorials like these. Some may have been written before Genesis 2.x, so be sure to adjust where necessary.

    How To Register Custom Sidebars In Genesis
    http://torquemag.io/register-sidebars-genesis/

    How to Add a Widgeted Area (a.k.a. Sidebar)
    http://designsbynickthegeek.com/tutorials/add-widgeted-sidebar

    How to Load a New Section on Specific Pages
    http://designsbynickthegeek.com/tutorials/conditional-page-content

    Creating a Genesis Child Theme from Scratch of the Genesis Framework in WordPress
    http://wpbeaches.com/creating-wordpress-child-theme-genesis-framework/

    The Genesis community reaches far beyond the bounds of this forum:
    Follow #GenesisWP on Twitter.
    Join the GenesisWP group on Facebook and/or Google Plus.
    Join the Slack channel for GenesisWP.
    Buy the book(s) from Gary Jones http://gamajo.com/


    Choose your next site design from over 350 Genesis themes.
    [ Follow me: Twitter ] [ Follow Themes: Twitter ] [ My Favourite Webhost ]

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