• Resolved fastfasterfastest

    (@fastfasterfastest)


    If a menu is not assigned as a Primary Navigation, some space will still be taken up by the html generated.

    If no Primary Navigation has been assigned, Virtue still emits
    <div class="... kad-header-right"><nav id="nav-main" ...></nav></div>
    and it will occupy (at least) 1 pixel.

    In header.php, the test for has_nav_menu('primary_navigation') on line 70 could be moved to line 66, and then the <div><nav></nav></div> wouldn’t be emitted and no space would be taken up by a non-existent primary navigation.

Viewing 4 replies - 1 through 4 (of 4 total)
  • This would only really effect a site if you are using the centered logo right?

    Kadence Themes

    Thread Starter fastfasterfastest

    (@fastfasterfastest)

    It effects sites with non-centered logos as well. With a vanilla site using Virtue, and no primary navigation and default logo position (on the left), the non-existent primary navigation occupies 1px thanks to a min-height on kad-header-right.

    Now, if you have a centered logo (and this is how I discovered this) then it gets “worse” – then there is an additional 50px occupied by the non-existent primary navigation thanks to margins on #nav-main.

    I think it would make sense that if one has no primary navigation then no space should be taken up by primary navigation. And moving the test for whether primary navigation has been assigned in header.php will result in that – no primary navigation, no html emitted for it, no “stray” min-heights and margins, etc.

    I’ll move the menu check in the next version of the theme.

    Kadence Themes

    Thread Starter fastfasterfastest

    (@fastfasterfastest)

    Great – thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Primary Navigation always occupies space’ is closed to new replies.