Nav Bar & Custom CSS/Php file updates
Support Area › Forums › Umami › Nav Bar & Custom CSS/Php file updates
- This topic has 3 replies, 2 voices, and was last updated 8 years, 7 months ago by Bill Robbins.
-
AuthorPosts
-
September 2, 2015 at 19:04 #32503Susan SchreinerParticipant
Hi Bill –
Two questions:
1) How can I increase the length of the left Nav bar to match the content transparency side? On some of our pages it stops long before the content side does and it looks odd. I’ve dug through the archives and I’m not seeing this.
2) I updated the both the Custom CSS (with your expert guidance) and the widget-contact.php file to add more time/day slots. To preserve these after theme updates do we need to use a child theme so they’re not overlaid?
Thank you for your help.
SusanSeptember 3, 2015 at 08:54 #32506Bill RobbinsModeratorHi,
I’ll need to see the site to know exactly what’s happening there.
Thanks,
BillSeptember 3, 2015 at 18:22 #32530Susan SchreinerParticipantThis reply has been marked as private.September 4, 2015 at 09:30 #32535Bill RobbinsModeratorLet’s give this a try:
- Go to the Appearance section in your WordPress dashboard and choose Edit.
- From the list of files on your right, choose custom-js.php
- Find this section:
jQuery('body').imagesLoaded( function() { if ( jQuery("#sidebar").height() > jQuery(window).height() ) { jQuery("body").addClass('taller'); } });
and replace it with this:
jQuery('body').imagesLoaded( function() { var $side = jQuery("#sidebar").height(); var $win = jQuery(window).height(); if ( $side > $win ) { jQuery("body").addClass('taller'); } var leftHeight = jQuery("#content").height(); var rightHeight = jQuery("#sidebar").height(); var documentWidth = jQuery(document).width(); if (documentWidth > 767){ if (leftHeight > rightHeight){ jQuery("body.taller #sidebar").height( leftHeight - 140 )} else{ jQuery("#content").height( rightHeight )}; }; });
- Save your changes.
The sidebar positioning has been a sticking point with me and this theme since the beginning. The intention is to have the sidebar fixed in place if all its content is visible. It should only scroll if some of the sidebar is out of frame.
I hope one day to have the time to crack this back open and get it resolved once and for all.
Anything in the Custom CSS that’s in the theme options will be fine in an update. If you have more than 10 lines there, I would probably roll that into a child theme to keep the code clean, but that’s just a personal preference.
You can make the widget changes in a child theme. It’s a function file which means it will have to be overridden by creating a new function in the child theme to load it there instead of in the parent. It’s not like a template file that you can simply place in the child theme to override.
There’s a quick post at http://www.organizedthemes.com/advanced-child-theme-usage/ that can give you an idea about how to do that. If memory serves, you’ll need to replace the function in the parent theme that loads all of the accessory files. Then change the line that loads this widget from get_template_directory to get_stylesheet_directory so it loads in the child.
One last item here. WordPress 4.3 changed the php constructor type that is used at the top of these widgets. So this widget will have a slight change in the next theme update. You’ll want to incorporate the new code into the widget. The old will still work at least for the near future.
Take care,
Bill -
AuthorPosts
- The topic ‘Nav Bar & Custom CSS/Php file updates’ is closed to new replies.