ShiftNav v1.8 Update Notes

Overview

There’s a small chance that when updating from a version older than 1.8, that you’ll encounter an issue where the toggle bar is not visible if your theme does not support a standard theme hook. If that’s the case, you’ll need to switch the Toggle Bar Injection setting to Footer after updating.

Quick Fix: How to resolve missing toggle bar after update

If your toggle bar disappears after updating, it’s likely because your theme doesn’t meet current WordPress standards and is lacking the standard wp_body_open hook.

Ideally, the theme should be updated to support this hook.

However, as a quick fix, you can change the Toggle Bar Injection setting to Footer in Appearance > ShiftNav > Toggle Bar

This will add ShiftNav to the wp_footer hook instead.

Many plugins require this standard WordPress hook, so you if your theme does not support it, you should contact your theme author and request that they add it to their theme.

Background

There are standard WordPress hooks that every theme must integrate into their template code to meet WordPress standards – you’re likely familiar with wp_head and wp_footer. These hooks make WordPress extensible by plugins are are required for compatibility.

In 2019, WordPress core added the wp_body_open hook as a standard hook to be used by themes. Prior to that, there was no standard way for plugins to inject code at the top of the document body. Most plugins, including ShiftNav, used wp_footer instead, as an imperfect workaround.

Since 2019, all themes should support this hook – however, we understand that adoption takes time. As of this writing in 2024, there has been plenty of time and pretty much every theme should support this hook by now. Therefore, the wp_body_open hook has now been set as the default injection point – though we still provide the footer as an option.

Why was this change made?

The main driving force behind this change is better accessibility. By putting the toggle in the footer, by default, the toggle would be the last in the sequence of actions available for those using screen readers or keyboards to navigate the site. As a workaround in prior versions, we set an explicit tabindex of 1. This works, but is brittle, and tends to upset accessibility checker tools and those reviewing site accessibility. By moving the toggle to the top of the content where it belongs, those using accessible means to navigate the site will have a better experience.

Bottom line is that the proper location to insert the toggle bar is before the body content, not after, so that should be the default now that it is an option.

Who will encounter an issue with this update?

99% of users should have a seamless update experience – as long as their theme is coded to WordPress standards and includes the wp_body_open hook or function, nothing should change visually, and the accessibility upgrades under the hood will work without issue.

For those running a theme that doesn’t support that hook, users will need to make a one-time setting change to load the toggle bar in the footer instead, as described in the Quick Fix section above. Though we definitely recommend that you should encourage your theme author to update the theme to support this hook, as many other plugins will also rely on it for their functionality.

On this page