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 12 years, 3 months ago by
Jen Baumann.
-
AuthorPosts
-
December 13, 2012 at 11:53 pm #5175
Axman1413
MemberMy 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 #5212AnitaC
KeymasterSo 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.
Need help with customization or troubleshooting? Reach out to me.
December 14, 2012 at 5:12 pm #5290Axman1413
MemberWell 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 #5294AnitaC
KeymasterSorry 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 '';
}
}
Need help with customization or troubleshooting? Reach out to me.
December 14, 2012 at 5:24 pm #5295Axman1413
MemberLOL, 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 #5296AnitaC
KeymasterI know... I have a great name! Good luck, let me know how it turns out.
Need help with customization or troubleshooting? Reach out to me.
December 14, 2012 at 5:31 pm #5297AnitaC
KeymasterThis 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/.
Need help with customization or troubleshooting? Reach out to me.
December 14, 2012 at 6:31 pm #5303Axman1413
MemberWell 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 Baumann
ParticipantDecember 15, 2012 at 9:22 am #5406AnitaC
KeymasterHi 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?
Need help with customization or troubleshooting? Reach out to me.
December 15, 2012 at 9:25 am #5407Jen Baumann
ParticipantYep!
December 15, 2012 at 9:37 am #5408AnitaC
KeymasterGreat. Can you delete or close my post in the General area pertaining to this? Thank you.
Need help with customization or troubleshooting? Reach out to me.
December 15, 2012 at 10:07 am #5414Axman1413
MemberWonderful...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 Baumann
ParticipantGreat!
-
AuthorPosts
- The topic ‘Where can I find the Header Right function?’ is closed to new replies.