Community Forums › Forums › Archived Forums › General Discussion › lib/init.php needed??
Tagged: genesis resources, Sidebar
- This topic has 6 replies, 4 voices, and was last updated 9 years, 7 months ago by Tom.
-
AuthorPosts
-
August 17, 2014 at 12:55 pm #119385mmjaegerMember
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 #119515mmjaegerMemberbump
August 18, 2014 at 7:18 am #119516Ben @ Inbound CreativeMemberThe 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.
August 18, 2014 at 8:18 am #119530TomParticipant@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 #119532mmjaegerMemberI'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 #149701yogidevMemberI 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 #149747TomParticipantHi @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 Joneshttp://gamajo.com/
Choose your next site design from over 350 Genesis themes.
[ Follow me: Twitter ] [ Follow Themes: Twitter ] [ My Favourite Webhost ] -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.