• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Cafe Pro | How to make mobile responsive 'secondary' menu the default?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Cafe Pro | How to make mobile responsive 'secondary' menu the default?

This topic is: resolved

Tagged: cafe pro

  • This topic has 1 reply, 1 voice, and was last updated 10 years, 3 months ago by Skysage.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 3, 2015 at 12:27 pm #146574
    Skysage
    Member

    In Cafe Pro, the primary navigation starts out at the bottom of the front page and then moves to the top and changes to the responsive secondary menu when you scroll down.

    I’d like to have this secondary responsive menu [with site title] as a default on all pages and make it so that it is always on top.

    I found the .primary nav styles in the css. But setting position fixed doesn't achieve the desired result.

    Based on similar queries I realize that the change must be made in the jquery files, but I'm not exactly sure what to change. Could someone provide a hint or advice on how to achieve the above?

    Here are the relevant jquery files

    Global.js

    jQuery(function( $ ){
    
    	$('.site-header').addClass('front-page-header');
    	
    	$('.footer-widgets').prop('id', 'footer-widgets');
    
    	$(".nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu").addClass("responsive-menu").before('<div class="responsive-menu-icon"></div>');
    
    	$(".responsive-menu-icon").click(function(){
    		$(this).next(".nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu").slideToggle();
    	});
    
    	$(window).resize(function(){
    		if(window.innerWidth > 800) {
    			$(".nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu, nav .sub-menu").removeAttr("style");
    			$(".responsive-menu > .menu-item").removeClass("menu-open");
    		}
    	});
    
    	$(".responsive-menu > .menu-item").click(function(event){
    		if (event.target !== this)
    		return;
    			$(this).find(".sub-menu:first").slideToggle(function() {
    			$(this).parent().toggleClass("menu-open");
    		});
    	});
    	
    	// Local Scroll Speed
    	$.localScroll({
    		duration: 750
    	});
    
    	// Sticky Navigation
    	var headerHeight = $('.site-header').innerHeight();
    	var beforeheaderHeight = $('.before-header').outerHeight();
    	var abovenavHeight = headerHeight + beforeheaderHeight - 1;
    
    	$(window).scroll(function(){
    
    		if ($(document).scrollTop() > abovenavHeight){
    
    			$('.nav-primary').addClass('fixed');
    
    		} else {
    
    			$('.nav-primary').removeClass('fixed');
    			
    		}
    		
    	});
    
    });

    Home.js

    jQuery(function( $ ){
    	
    	// Header Height
    	var navHeight = $('.nav-primary').outerHeight();
    	var snavHeight = $('.nav-secondary').outerHeight();
    	var beforeheaderHeight = $('.before-header').outerHeight();
    	var windowHeight = $(window).height();
    	var newHeight = windowHeight - navHeight - snavHeight - beforeheaderHeight;
    	
    	$('.front-page-header') .css({'height': newHeight +'px'});
    	$('.image-section') .css({'height': windowHeight +'px'});
    		
    	$(window).resize(function(){
    	
    	var navHeight = $('.nav-primary').outerHeight();
    	var snavHeight = $('.nav-secondary').outerHeight();
    	var beforeheaderHeight = $('.before-header').outerHeight();
    	var windowHeight = $(window).height();
    	var newHeight = windowHeight - navHeight - snavHeight - beforeheaderHeight;
    	
    		$('.front-page-header') .css({'height': newHeight +'px'});
    		$('.image-section') .css({'height': windowHeight +'px'});
    	
    	});
    	
    	// Sticky Navigation
    	var headerHeight = $('.site-header').innerHeight();
    	var beforeheaderHeight = $('.before-header').outerHeight();
    	var abovenavHeight = headerHeight + beforeheaderHeight - 1;
    
    	$(window).scroll(function(){
    
    		if ($(document).scrollTop() > abovenavHeight){
    
    			$('.nav-primary').addClass('fixed');
    
    		} else {
    
    			$('.nav-primary').removeClass('fixed');
    			
    		}
    		
    	});
    
    });

    http://demo.studiopress.com/cafe/

    http://demo.studiopress.com/cafe/
    April 3, 2015 at 12:49 pm #146577
    Skysage
    Member

    I solved it.

    Here's the code I changed:

    Home.js

    jQuery(function( $ ){
    	
    	// Header Height
    	var navHeight = $('.nav-primary').outerHeight();
    	var snavHeight = $('.nav-secondary').outerHeight();
    	var beforeheaderHeight = $('.before-header').outerHeight();
    	var windowHeight = $(window).height();
    	var newHeight = windowHeight - navHeight - snavHeight - beforeheaderHeight;
    	
    	$('.front-page-header') .css({'height': newHeight +'px'});
    	$('.image-section') .css({'height': windowHeight +'px'});
    		
    	$(window).resize(function(){
    	
    	var navHeight = $('.nav-primary').outerHeight();
    	var snavHeight = $('.nav-secondary').outerHeight();
    	var beforeheaderHeight = $('.before-header').outerHeight();
    	var windowHeight = $(window).height();
    	var newHeight = windowHeight - navHeight - snavHeight - beforeheaderHeight;
    	
    		$('.front-page-header') .css({'height': newHeight +'px'});
    		$('.image-section') .css({'height': windowHeight +'px'});
    	
    	});
    	
    	// Sticky Navigation
    	var headerHeight = $('.site-header').innerHeight();
    	var beforeheaderHeight = $('.before-header').outerHeight();
    	var abovenavHeight = headerHeight + beforeheaderHeight - 1;
    
    	if( $( document ).ready()){
    
    			$('.nav-primary').addClass('fixed');
    
    		} 
    		
    	});

    Global.js

    jQuery(function( $ ){
    
    	$('.site-header').addClass('front-page-header');
    	
    	$('.footer-widgets').prop('id', 'footer-widgets');
    
    	$(".nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu").addClass("responsive-menu").before('<div class="responsive-menu-icon"></div>');
    
    	$(".responsive-menu-icon").click(function(){
    		$(this).next(".nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu").slideToggle();
    	});
    
    	$(window).resize(function(){
    		if(window.innerWidth > 800) {
    			$(".nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu, nav .sub-menu").removeAttr("style");
    			$(".responsive-menu > .menu-item").removeClass("menu-open");
    		}
    	});
    
    	$(".responsive-menu > .menu-item").click(function(event){
    		if (event.target !== this)
    		return;
    			$(this).find(".sub-menu:first").slideToggle(function() {
    			$(this).parent().toggleClass("menu-open");
    		});
    	});
    	
    	// Local Scroll Speed
    	$.localScroll({
    		duration: 750
    	});
    
    	// Sticky Navigation
    	var headerHeight = $('.site-header').innerHeight();
    	var beforeheaderHeight = $('.before-header').outerHeight();
    	var abovenavHeight = headerHeight + beforeheaderHeight - 1;
    
    	if( $( document ).ready()){
    
    			$('.nav-primary').addClass('fixed');
    
    		} 
    		
    	});
  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble