Nav Bar & Custom CSS/Php file updates

Support Area Forums Umami Nav Bar & Custom CSS/Php file updates

Viewing 4 posts - 1 through 4 (of 4 total)
URL to the page in question: http://
  • Author
    Posts
  • #32503
    Susan Schreiner
    Participant

    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.
    Susan

    #32506
    Bill Robbins
    Moderator

    Hi,

    I’ll need to see the site to know exactly what’s happening there.

    Thanks,
    Bill

    #32530
    Susan Schreiner
    Participant
    This reply has been marked as private.
    #32535
    Bill Robbins
    Moderator

    Let’s give this a try:

    1. Go to the Appearance section in your WordPress dashboard and choose Edit.
    2. From the list of files on your right, choose custom-js.php
    3. 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 )};
      		};
      					
      	});
      
    4. 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

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Nav Bar & Custom CSS/Php file updates’ is closed to new replies.