Community Forums › Forums › Archived Forums › Design Tips and Tricks › Help Adding a Widget Area to Genesis Magazine Child Theme Header
- This topic has 5 replies, 3 voices, and was last updated 11 years, 2 months ago by perplexed.
-
AuthorPosts
-
February 17, 2013 at 2:59 pm #20880perplexedMember
Good Afternoon,
I'm attempting to customize the Genesis Magazine Child Theme. Having never worked with the Genesis framework before, I'm finding this quite challenging. The test site is located here:
http://greenhousegraphix.com/crunchy/What I'm trying to do is add a widget to the top left corner to house the logo. I'm using a widget because there will be 4 logos, one for each season, and I thought this would be an easy way for the user to change them.
Here's what I've done.
1. duplicated lib/structure/header.php from the genesis folder and placed into the magazine folder. (I assumed I had to keep this same structure)
2. I changed line 847-851 to:
function genesis_do_header() {
echo '<div id="title-area">';
dynamic_sidebar( 'logo' );
echo '</div><!-- end #title-area -->';
3. I added to functions.php:
genesis_register_sidebar( array(
'id' => 'logo',
'name' => __( 'logo', 'magazine' ),
'description' => __( 'This is the logo.', 'magazine' ),
) );
I'm sure I've done something wrong, any insight would be appreciated.
Thanks.February 17, 2013 at 5:54 pm #20903cehwithamMemberHi,
I think you're over complicating this a bit. There's actually no need to duplicate the header.php file and location (although this is common when editing some other child themes that aren't based on Genesis).
I suggest you start by reading up on hooks here: http://my.studiopress.com/docs/hooks/
What you essentially need to do is (this can all be done in functions.php in your child theme)Remove the title and tagline:
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );Then write a function to output your widget area (note you will need to register your widget area too):
function output_my_logo(){
if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'logo' ) ) {
}}
Then add this function to the header using:
add_action( "genesis_site_title", "output_my_logo");
I hope this helps.
Chris
Twitter: cehwitham Web: cehwitham.com
February 18, 2013 at 12:31 pm #21053perplexedMemberHi Chris,
Thank you for your explination. I'm afraid that I'm still missing something.
Here's what I added to functions.php:
/** Replace Site Title & Description with logo widget area */
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
function output_my_logo(){
if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'logo' ) ) {
}
}
add_action( 'genesis_site_title', 'output_my_logo');And I registered the sidebar:
genesis_register_sidebar( array(
'id' => 'logo',
'name' => __( 'Logo', 'magazine' ),
'description' => __( 'This is the logo.', 'magazine' ),
) );I see the logo widget in the backend, and I added content to it, but it doesn't show. Have I missed a step?
February 18, 2013 at 1:28 pm #21068Brad DaltonParticipantThere's a plugin for multiple header images: http://wordpress.org/extend/plugins/wp-display-header/
You could also add the logos to a transparent background.
Another option is the Genesis Simple Headers plugin http://wordpress.org/extend/plugins/genesis-simple-headers/screenshots/
February 18, 2013 at 5:00 pm #21121cehwithamMemberCan you check that the single quotes mark has copied ok to your functions.php file?
It's showing in your post as ‘ instead of ' sometimes makes a difference.
It's good if you can add it, there may be an error in the code I posted for the output. Can you see if it works if you change it to:
function output_my_logo(){
dynamic_sidebar( 'logo' );
}
add_action( 'genesis_site_title', 'output_my_logo');
Twitter: cehwitham Web: cehwitham.com
February 18, 2013 at 6:32 pm #21160perplexedMemberHi Chris,
No luck. I decided to give up and use a header image instead. Thanks for your help!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.