Fixed element when scrolling

Hi support
Is it possible to to fix a section so that it stays on the page when you scroll down…
i have a bar under my menu wher i want to show some links and i want it to be fixed when scrolling down - preferably on all sites.

can you help me?

Hello There,

Unfortunately, that is not possible out of the box using X theme. To achieve that in X theme, you need to edit a template. The template responsible is this: _navbar.php. You can find the file here:

\wp-content\themes\x\framework\legacy\cranium\headers\views\global

Copy the file on your child theme on this location:

\wp-content\themes\x-child\framework\legacy\cranium\headers\views\global

If the location on your child theme doesn’t exist, please create the folder.
Then open the copied file, at the end you can see the following. See the position where you can add it. I add a comment:

<?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>
      <!-- Add the content you want to be sticky too below the navigation bar-->
    </div>
  </div>

<?php endif; ?>

About the content though, it would then be outside the scope of our support.

On the other hand, this can easily be achieve using Pro Header builder. If you will install the starter template, check the Sticky Bar template for header. It has the settings you need.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.