Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #978523
    ldenapoli
    Participant

    Hey X help,

    I need some help getting the logo to come up under the menu bar and stay static. I have already found the workflow on the forum to do each independently with the child theme and tried to hack the two methods together unsuccessfully. I got close but the menu bar color is coming up in the wrong place and not really working. Can you please take a look to see where I went wrong. Thanks so much!!!

    <?php

    // =============================================================================
    // VIEWS/GLOBAL/_NAVBAR.PHP
    // —————————————————————————–
    // Outputs the navbar.
    // =============================================================================

    $navbar_position = x_get_navbar_positioning();
    $logo_nav_layout = x_get_logo_navigation_layout();
    $is_one_page_nav = x_is_one_page_navigation();

    ?>

    <?php if ( ( $navbar_position == ‘static-top’ || $navbar_position == ‘fixed-top’ || $is_one_page_nav ) && $logo_nav_layout == ‘stacked’ ) : ?>

    <div class=”x-navbar-wrap”>
    <div class=”<?php x_navbar_class(); ?>”>
    <div class=”x-navbar-inner”>
    <div class=”x-container max width”>
    <?php x_get_view( ‘global’, ‘_nav’, ‘primary’ ); ?>
    </div>
    </div>
    </div>
    </div>

    <div class=”x-logobar”>
    <div class=”x-logobar-inner”>
    <div class=”x-container max width”>
    <?php x_get_view( ‘global’, ‘_brand’ ); ?>
    </div>
    </div>
    </div>

    <?php else : ?>

    <div class=”x-navbar-wrap”>
    <div class=”<?php x_navbar_class(); ?>”>
    <div class=”x-navbar-inner”>
    <div class=”x-container max width”>

    <?php x_get_view( ‘global’, ‘_nav’, ‘primary’ ); ?>
    <?php x_get_view( ‘global’, ‘_brand’ ); ?>
    </div>
    </div>
    </div>
    </div>

    <?php endif; ?>

    #978819
    Rahul
    Moderator

    Hi,

    Can you please share the link to your website?

    Thanks

    #980086
    ldenapoli
    Participant

    Sure:-)

    http://oisforolivia.com/

    Thanks for taking a look.

    d

    #980192
    Thai
    Moderator

    Hi There,

    Please replace your code with this:

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_NAVBAR.PHP
    // -----------------------------------------------------------------------------
    // Outputs the navbar.
    // =============================================================================
    
    $navbar_position = x_get_navbar_positioning();
    $logo_nav_layout = x_get_logo_navigation_layout();
    $is_one_page_nav = x_is_one_page_navigation();
    
    ?>
    
    <?php if ( ( $navbar_position == 'static-top' || $navbar_position == 'fixed-top' || $is_one_page_nav ) && $logo_nav_layout == 'stacked' ) : ?>
    
      <div class="x-navbar-wrap">
        <div class="<?php x_navbar_class(); ?>">
          <div class="x-navbar-inner">
            <div class="x-container max width">
              <?php x_get_view( 'global', '_nav', 'primary' ); ?>
            </div>
          </div>
        </div>
      </div>
    
      <div class="x-logobar">
        <div class="x-logobar-inner">
          <div class="x-container max width">
            <?php x_get_view( 'global', '_brand' ); ?>
          </div>
        </div>
      </div>
    
    <?php else : ?>
    
      <div class="x-navbar-wrap">
        <div class="<?php x_navbar_class(); ?>">
          <div class="x-navbar-inner">
            <div class="x-container max width">
              <?php x_get_view( 'global', '_brand' ); ?>
              <?php x_get_view( 'global', '_nav', 'primary' ); ?>
            </div>
          </div>
        </div>
      </div>
    
    <?php endif; ?>

    If it doesn’t work, please provide us with your FTP account so we can take a closer look.

    Thank you.

    #980440
    ldenapoli
    Participant
    This reply has been marked as private.
    #980759
    Christopher
    Moderator

    Hi there,

    Please add following code in Customize -> Custom -> CSS :

    .x-logobar.x-navbar-fixed-top {
        position: fixed;
        right: 0;
        left: 0;
        top: 30px;
    }

    Please add following code in Customize -> Custom -> JavaScript :

    jQuery(document).ready(function($){
    	$(window).scroll(function(){
    		if ($(this).scrollTop() > 10) {
    			$('.x-logobar').addClass("x-navbar-fixed-top");
    		} else {
    			$('.x-logobar').removeClass("x-navbar-fixed-top");
    		}
    	});
    });

    Hope it helps.

    #983185
    ldenapoli
    Participant

    Thanks, that work OK but its a little jumpy and after seeing it in action my wife is not loving it

    #983570
    Rupok
    Member

    Hi there,

    Thanks for updating. If you want this to be more smoother then you need some more custom development and need to use jQuery UI tool. Further customizations from here would be getting into custom development, which is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding.

  • <script> jQuery(function($){ $("#no-reply-978523 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>