Community Forums › Forums › Archived Forums › Design Tips and Tricks › Where can I find the Header Right function?
- This topic has 13 replies, 3 voices, and was last updated 11 years, 3 months ago by Jen Baumann.
-
AuthorPosts
-
December 13, 2012 at 11:53 pm #5175Axman1413Member
My client wants me to add a logo/header in the area where the Header Right Widget will be. However, she doesn'tw ant it ont he Home page, where we have the slider. So I'm guessing it would be something like:
remove_action--genesis_header_right...so on
if (is_front_page)...something, something ...hehehe.
I just can't find the initial widget function to copy in order to ad the conditional remove function to the Executive function.php.
I am intermediate with php. I am better at manipulating than writing. So if you can lead me in the right direction, or just provide the correct function call so I can have the Header Right widget appear on all pages, EXCEPT the static Home page.
Thanks,
Johnny
December 14, 2012 at 9:41 am #5212AnitaKeymasterSo this is how you would actually remove it all together -
/** Remove the header right widget area */
unregister_sidebar( 'header-right' );But, if you only want to remove it from the home and show it on the single post/pages, then you need to add to your code the "is_single()" function.
I found a blog that might help you - scroll down where it says, "Can I say Which Pages the Widget Shows Up On? - http://journalxtra.com/easyguides/howto-add-widgets-genesis-child-themes-4876/.
Sorry I cannot be of more help. I am not good at this either.
Love coffee, chocolate and my Bella!
December 14, 2012 at 5:12 pm #5290Axman1413MemberWell the problem I'm having is that I just want it removed from the front_page, not the home_page. If it were the home_page, I could just jump in that file and alter it. But the static home page doesn't have this availability in Genesis.
I've been looking at Nick's stuff, but I'm spending way too much time on this. I could have gotten all these results using my Pro Version of WeaverII, where I don't have to code. It's frustrating, when a client insists on a theme, but then wants to make crazy changes.
I just need to find the add_action function for the header-right in the Genesis files, so I can copy it an rewrite it in the child f.p to not show on the is_front_page
So I'm not sure if a filter would work or what the best option is. There is a ton of material on adding things, but not a lot on removing them.
Johnny
December 14, 2012 at 5:20 pm #5294AnitaKeymasterSorry I couldn't be of more help and I see no one else has chimed in. I did another Google search and found this - http://stackoverflow.com/questions/11206736/wordpress-genesis-theme-changing-the-logo-from-text-to-graphic and it has the following code in it - but read the link.
if ( is_active_sidebar( 'header-right' ) || has_action( 'genesis_header_right' ) ) {
echo '';
do_action( 'genesis_header_right' );
dynamic_sidebar( 'header-right' );
echo '';
}
}
Love coffee, chocolate and my Bella!
December 14, 2012 at 5:24 pm #5295Axman1413MemberLOL, Thanks Anita (funny...that's my client's name) I just found that code in the Genesis files. Now let's see if I can rewrite it correctly.
Johnny
December 14, 2012 at 5:25 pm #5296AnitaKeymasterI know... I have a great name! Good luck, let me know how it turns out.
Love coffee, chocolate and my Bella!
December 14, 2012 at 5:31 pm #5297AnitaKeymasterThis article on this link says you need to specify that you want it on "single posts" only (not home page). Scroll down to the bottom and you should see it - http://blogvkp.com/add-widget-in-genesis-child-theme/.
Love coffee, chocolate and my Bella!
December 14, 2012 at 6:31 pm #5303Axman1413MemberWell I'm not sure, but this is what I'm thinking. I just don't know how to introduce it into the child function.php:
if ( is_active_sidebar( 'header-right' ) || has_action( 'genesis_header_right' ) ) {
if (is_front_page() {
echo '';
}
if (is_page() {
echo '^div class="widget-area"^';
do_action( 'genesis_header_right' );
dynamic_sidebar( 'header-right' );
echo '^/div^^!-- end .widget-area --^';
}
}In the child theme, it just calls the entire genesis_custom_header, so there is more needed to get this to interact with the child theme.
I'm using"^" in place of ">/<"
Johnny
December 15, 2012 at 9:18 am #5405Jen BaumannParticipantDecember 15, 2012 at 9:22 am #5406AnitaKeymasterHi Jen, thank you for helping. I thing he and I were at our wits end! Now, that code you supplied - does it go into the Functions.php file?
Love coffee, chocolate and my Bella!
December 15, 2012 at 9:25 am #5407Jen BaumannParticipantYep!
December 15, 2012 at 9:37 am #5408AnitaKeymasterGreat. Can you delete or close my post in the General area pertaining to this? Thank you.
Love coffee, chocolate and my Bella!
December 15, 2012 at 10:07 am #5414Axman1413MemberWonderful...wonderful!!! The only change I had to make was to put (is_front_page) in place of (is_home).
Thank you both for all your help.
Johnny
December 15, 2012 at 10:10 am #5415Jen BaumannParticipantGreat!
-
AuthorPosts
- The topic ‘Where can I find the Header Right function?’ is closed to new replies.