How to Create a Vertical Navigation Menu in WordPress

Are you looking to create a vertical navigation menu in WordPress?

In WordPress, navigation menus can be displayed horizontally or vertically. Vertical menus offer a number of advantages, such as fitting your website’s sidebar better and being easier to navigate on mobile devices.

In this article, we’ll show you how to create a vertical navigation menu in WordPress.

How to Create a Vertical Navigation Menu in WordPress

What Is a Navigation Menu?

A navigation menu is a list of links pointing to important areas of a website. They are usually presented as a horizontal bar of links at the top of every page on a WordPress website.

Navigation menus give your site structure and help visitors find what they’re looking for. You can add links to your most important pages, categories or topics, WordPress blog posts, and even custom links such as your social media profile.

But while you often see them placed horizontally at the top of a website, vertical navigation menus have many uses and advantages.

With that being said, let’s take a look at a number of ways to create a vertical navigation menu in WordPress. Here are the topics we’ll cover in this article:

Try Different Menu Display Locations

When you add a navigation menu to your website, it will be displayed either vertically or horizontally. This depends on your theme, as well as the menu location you select.

The number of menu locations that are available depends on the theme you are using. You may find that some of these locations display the menu vertically.

To test this with your theme, you need to navigate to Appearance » Menus. Here you can experiment to see which locations are available on your website and how they are displayed.

Note: If you see ‘Appearance » Editor (Beta)’ instead of ‘Appearance » Menus’, then your theme has Full Site Editing (FSE) enabled. You’ll need to refer to the Creating a Vertical Navigation Menu Using the Full Site Editor section below.

For example, the Twenty Twenty-One theme doesn’t offer any vertical locations, while the Twenty Twenty theme offers one, called ‘Desktop Expanded Menu’.

The Twenty Twenty Theme Has One Vertical Menu Location

You can simply select the menu that you wish to display vertically, and then check the ‘Desktop Expanded Menu’ box at the bottom of the screen. After that, you must make sure to click the ‘Save Menu’ button to store your settings.

This is how it looks on our demo website.

Twenty Twenty Vertical Menu Position Preview

For more information on editing menus and menu locations, you can see our beginner’s guide on how to add a navigation menu in WordPress.

Adding a Vertical Navigation Menu to the Sidebar

No matter what theme you’re using, it’s easy to add a vertical navigation menu to the sidebar using a widget.

First, you’ll need to create a navigation menu that you want to display, if you haven’t already.

Then you need to navigate to Appearance » Widgets. From here, simply click the blue ‘+’ block inserter button found at the top of the page, and drag the Navigation Menu block onto the sidebar.

Add the Navigation Menu Block to the Sidebar

After that, you can give the widget a name and select the menu you wish to display from the drop down menu.

Here’s how the vertical sidebar menu looks on our demo website.

Preview of Vertical Navigation Menu in Sidebar

Creating a Vertical Navigation Menu on a Post or Page

You can add a vertical navigation menu to posts and pages in a similar way.

First, you need to create a new post or edit an existing one. After that, you need to click the blue ‘+’ block inserter button at the top of the page, and then drag the Navigation block onto the page.

Add the Navigation Block to Your Post or Page

Next, you need to choose which menu will be displayed. Simply click the ‘Select Menu’ button on the toolbar and select the desired menu.

Finally, you need to look at the block’s settings in the left hand pane. There you will find two buttons for the menu’s orientation. You will need to click the down arrow button to orient the menu vertically.

Change Your Navigation Menu Block to a Vertical Orientation

Adding a Vertical Navigation Menu Using the Full Site Editor

The new full site editor allows you to customize your WordPress themes using the block editor. It was released in WordPress 5.9, and it enables you to add different blocks to your templates to create a unique design.

However, the full site editor is still in beta and limited to specific themes that support it, such as the default Twenty Twenty-Two theme. For more details, you can see our article on the best WordPress full site editing themes.

To add a navigational menu using the full site editor, you need to go to Appearance » Editor from your WordPress dashboard. Once you’re in the editor, go ahead and click on the navigational menu that appears at the top of the website header.

Next, you’ll need to click on the ‘Select Navigation’ button on the toolbar.

Click the 'Select Navigation' Menu on the Toolbar

Now you’ll see different options to customize the navigational menu on the panel on the right. One of those options is whether to display the menu with a horizontal or vertical orientation.

Simply click the Down arrow for vertical orientation to create a vertical menu.

Click the Down Arrow for Vertical Orientation to Create a Vertical Menu

For more information, see our guide on how to add a navigation menu in WordPress

Creating a Vertical Navigation Menu using a Theme Builder Plugin

SeedProd is the best WordPress page builder and custom theme builder plugin on the market. It allows you to easily create vertical menus anywhere on your WordPress website.

The first thing you need to do is install and activate the SeedProd plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Note: There is a free version of SeedProd that will allow you to add a vertical navigation menu to individual pages. But you will need the Pro version to access the theme builder and add a menu to your theme’s templates.

Upon activation, you need to enter your license key. You can find this information under your account on the SeedProd website.

SeedProd license key

After that, you need to use SeedProd to create a custom WordPress theme.

Creating a Custom WordPress Theme

You’ll find the SeedProd theme builder by navigating to the SeedProd » Theme Builder page. Here, you’ll use one of SeedProd’s ready-made themes as a starting point. This will replace your existing WordPress theme with a new, custom design.

You can do that by clicking the ‘Themes’ button.

Create your custom theme

You will be shown a list of professionally designed themes for different types of websites. For example, there are templates called ‘Modern Business’, ‘Marketing Agency’, and ‘Mortgage Broker Theme’.

Take a look through the options and select one that best matches your needs by clicking the checkmark icon.

Select a Theme That Matches Your Needs

Once you have chosen a theme, SeedProd will generate all the theme templates you need. You can learn how to customize these templates in our guide on how to easily create a custom WordPress theme.

Adding a Vertical Navigation Menu to Your Site’s Templates

Now you can use SeedProd to add a vertical navigation menu to any of your theme templates. In this tutorial, we’ll add a menu to the blog index template.

You need to hover your mouse over that template, and then click the ‘Edit Design’ link.

Click the Edit Design Link

This will open SeedProd’s drag and drop page builder. You’ll see a preview of your website on the right, and a collection of blocks you can add to your site on the left.

You need to scroll down the blocks until you come to the Advanced section.

Once you locate the Nav Menu block you should drag it onto your sidebar or anywhere that you want to display the navigation menu. By default, there is only one item in the menu, ‘About’.

Drag the Nav Menu Block Onto the Page

Now you will need to change the menu’s settings. To do that, you need to click on the menu and the available options will be displayed in a pane on the left of the page.

Currently, the ‘Simple’ menu type is selected. This allows you to build your own navigation menu in SeedProd.

However, for this tutorial, we’ll click the ‘WordPress Menu’ type to use the WordPress navigation menu instead.

Click the WordPress Menu Option

Finally, you need to click on the ‘Advanced’ tab. Here you’ll find an option to orient the list layout vertically or horizontally.

When you click on the ‘Vertical’ button you’ll notice the preview immediately change to a vertical navigation menu.

Click the Vertical Option

Don’t forget to click the ‘Save’ button at the top of the screen to store your vertical menu.

Creating a Responsive Vertical Navigation Menu for Mobile Devices

It can be difficult to tap on a standard menu while using the small screen of a smartphone. That’s why we recommend that you preview the mobile version of your WordPress site to see how your website looks on mobile devices.

Vertical menus are much easier to navigate, especially when you use a fullscreen responsive menu that will automatically adjust to different screen sizes.

Fullscreen Menu Preview

To learn how to make your navigation menu easier to use on mobile devices, see our guide on how to add a fullscreen responsive menu in WordPress.

Creating a Drop Down Menu in WordPress

A dropdown menu looks like a normal horizontal navigation menu at the top of the screen, but when you hover your mouse over one of the items, a vertical submenu is displayed.

If you have a website with a lot of content, then a dropdown menu allows you to organize the menu structure by topics or hierarchy. This will show more content in a limited space.

Preview of a Dropdown Menu

To display a dropdown navigation menu on your website, you will need to choose a theme with dropdown menu support. After that, you need to create the navigation menu, and then add sub-items to some of the menu entries.

You can learn how to do that step by step in our beginner’s guide on how to create a dropdown menu in WordPress.

Creating a Mega Menu in WordPress

A mega menu lists multiple menus vertically across the page. They’re similar to dropdown menus, except all of the submenus are displayed at once, allowing users to quickly and easily find your very best content.

Mega menus are highly engaging and interactive because they combine the best of horizontal and vertical menus to show a helpful overview of your website’s contents on a single screen.

We recently added a mega menu to WPBeginner to improve content discoverability. We explain how we did this in our behind the scenes look at our new site design.

WPBeginner WordPress Mega Menu

You can learn more in our guide on how to add a mega menu to your WordPress site.

We hope this tutorial helped you learn how to create a vertical navigation menu in WordPress. You may also want to learn how to start your own podcast, or check out our expert comparison of the best domain registrars.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Create a Vertical Navigation Menu in WordPress first appeared on WPBeginner.

The Future Of Frontend Build Tools

Frontend build tooling is crucial to the workflow of the modern frontend developer for a host of reasons classified under improved developer and user experiences. From the developer’s perspective, frontend tooling gives us: the ability to author modules, a dev server for local development, Hot Module Replacement (HMR) for a shorter feedback loop in development mode, the ability to target legacy browsers with polyfills, processing a host of filetypes apart from JavaScript, the list goes on.

As a result, users can enjoy more capable and feature-rich applications that remain performant through techniques like code-splitting, caching, prefetching, and other resource optimization techniques — with some applications that are even able to work offline.

Frontend tooling gives us so much today that it is hard to imagine that there was a time when it was not even needed at all. A trip down memory lane could help us understand how we got here.

The Past

Before frontend applications became as complex as they are today, all JavaScript was used for was to add basic interactivity to otherwise simple HTML documents — similar to the way Adobe’s Flash was used.

There were no complex “JavaScript-heavy” applications, so, no need for any tooling to make authoring and shipping JavaScript better, but that would not remain the case.

As time went on and we started to create more involved user experiences on the web, we shifted from more static web pages to highly dynamic web applications serving user-specific data. These applications required more JavaScript than their traditional counterparts, and the limits of working with JavaScript became a lot more apparent.

There are two major ways to load JavaScript in the browser. One is with a script tag referencing a JavaScript file, and the other is to write your JavaScript directly in the HTML inside script tags.

<script src="my-javascript-file.js"></script>

<script>
    var a = 1;
    var b = 2;

    var result = a + b;
</script>

This limitation on loading JavaScript becomes a bottleneck when you have lots of JavaScript to load. There are browser limitations to loading many JavaScript files concurrently and maintainability issues with having one huge JavaScript file (like file size, scoping issues, namespace collision, and so on).

We came up with solutions like Immediately Invoked Function Expressions (IIFEs) to help with encapsulation and some of the scoping issues after which, we gained the ability to write our JavaScript in many different files. Then, we needed a way for these many files to be combined into one file to be served in the browser

The present

Being able to split our JavaScript into different files with IIFEs, it seemed like all we needed was a way to concatenate these files and ship a single file to the browser. This need saw the rise of tools like Gulp, Grunt, Brocolli, and so forth. However, we soon realized that our thinking might have been a little too simplistic.

As our applications got even more complex, matters like lack of dead code elimination, full rebuilds for small changes, and other performance issues made us realize that we needed something more than just concatenation. That gave rise to the more modern bundlers like Webpack, Parcel, and others.

With the pace of advancement in the frontend space not slowing down, we have started to observe gaps and issues with the modern build tools.

Some of the major limitations include:

  • Complex setup and configuration of some of these existing bundlers;
  • Increase in build times as applications get larger;
  • Suboptimal performance in development mode.

The rate at which things change in the JavaScript ecosystem is often fatiguing, but the upside is that the community quickly identifies problems and gets to work on potential solutions. With our sights set on improving the performance of frontend tooling, a new generation of build tools is being developed.

The Future

The limitations of the mainstream build tools of the day have led to several attempts to reimagine what a frontend build tool should be and do, and there are quite a few new build tools in the wild today.

Closer inspection will reveal that these new tools seem to be taking two major approaches to solving the problem (not necessarily mutually exclusive): a change in paradigm and a change in platform — both powered by new advancements in the web development ecosystem.

A Replatform

Frontend build tools have traditionally been built with JavaScript and, more recently, Typescript. This made sense, as JavaScript is the language of the web, and authoring build tools for the web in the same language makes it easier for more people to contribute to the effort and build a community around these tools. Still, there are inherent problems with this approach.

As a high-level language, JavaScript cannot reach native levels of performance. This means that tools built on top of this platform have a cap on how performant they can be. So, to break out of this limitation, newer build tools are being built on lower-level, inherently more performant languages like Rust.

Languages like Rust and Go have become popular options for authoring the next generation of build tools with a strong emphasis on performance. Rust, in particular, is popular not only for its performance but also for its impressive developer experience — voted the "most-loved" programming language six years in a row in the Stack Overflow Developer Survey.

In speaking about the decision to build Rome (the build tool and not the city) with Rust, Jamie Kyle says:

“Many others have communicated the performance, memory, and safety benefits of Rust before us — let’s just say everyone who has ever said Rust is good is correct. However, our biggest concern was our own productivity. [...]
After some prototyping, however, we quickly realized we might actually be more productive in Rust”

Jamie Kyle in Rome Will Be Written In Rust

The project SWC is at the forefront of this idea of using Rust for frontend build tools. It is now powering projects like Next.js’s new compiler, Deno, Parcel, and others — with a performance that is many orders of magnitude above other existing build tools.

Projects like SWC prove that with a change of the underlying platform, the performance of build tools can be significantly improved.

A paradigm shift

The way a typical frontend build pipeline works today is you author JavaScript modules in many different files, run a command, the build tool picks up these modules, bundles them into a single module, converts them to a format understood by browsers, and serves that file in the browser.

To improve the performance in development mode, a lot of the optimizations that would take more time to complete are left out and are, instead run when we are bundling our production application. This ensures that it takes as little time as possible to spin up a dev server, run our application in development mode and get productive.

The bundling process still takes quite some time, though and as a project grows, build times (even in development) only get longer and longer. Wouldn’t it be great if we could somehow skip bundling altogether while still being able to write modules as usual and have the browser understand how to work with them? A new set of build tools is taking this approach, known as Unbundled Development.

Unbundled development is great. It solves a major issue with existing build tools: they often need to rebuild entire sections of your application for even trivial code changes, and build times get longer as the application grows. We lose the rapid feedback — essential for a pleasant development experience.

One might wonder, if unbundled development is so great, why isn’t it the norm today? There are two major reasons why unbundled development is only starting to gain traction: browser compatibility for cutting edge features and processing node module imports.

1. Browser compatibility for cutting edge features

Unbundled Development is powered by ES Modules (ESM), which brings a standardized module system to JavaScript — supported natively across multiple runtimes, including the browser. With this new capability, we can mark our script tags as modules and can consequently use the import and export keywords that we are all familiar with;

<script type="module" src="main.js"></script>

<script type="module">
  /** JavaScript module code goes here */
</script>

ES modules have been around for quite some time. Still, we are only able to start taking advantage of it for things like unbundled development, mostly because of how long its standardization took across all the players in the web ecosystem.

In her article about ES Modules, on Mozilla Hacks, Lin Clark says:

“ES modules bring an official, standardized module system to JavaScript. It took a while to get here, though — nearly 10 years of standardization work.”

Lin Clark in ES Modules: A Cartoon Deep-Dive

The issue of browser support or lack thereof has plagued frontend development for a long time. This is why we have vendor prefixing our CSS, sometimes the reason for polyfills, why we spend time ensuring cross-platform support for our web applications, and why it sometimes takes quite some time before we can take advantage of the latest and greatest web features in our day to day work.

Try to visit a StackBlitz project using Safari, and you will be greeted with the following screen communicating the lack of support for WebContainers in non-Chromium-based browsers.

The pace of feature adoption is not the same across browser providers, and there are often variations in how different vendors implement certain features. However, the future looks bright with initiatives like Interop 2022.

2. Processing node module imports

Most, if not all, frontend applications we write today depend on external libraries from NPM. For a typical react application, We would import react at the top of our component files like so:

import React from 'react'

/** The rest of your component code */

Trying to load this directly in the browser, as we would need to do for unbundled development, will lead to two issues. First, the browser does not know how to resolve the path to find react and secondly, the react library is published as a Common JS (CJS) module — which cannot run natively in the browser without some pre-processing.

The latter is the bigger issue here, as it is possible, and even trivial, to simply replace our node module imports with relative paths to specific files. Still, the fact that most NPM packages are written in a module format more suitable for Node JS than the browser requires that our NPM dependencies are treated specially to facilitate unbundled development.

Snowpack, in particular, handles this by processing application dependencies into separate Javascript files that can then be used directly in the browser. More on how Snowpack does this can be found here.

With ES Modules now being mainstream in most modern browsers, and clever workarounds for NPM dependencies, build tools like Vite and Snowpack can offer the option of unbundled development with drastically improved performance, snappy builds, besides super fast HMR.

Final Thoughts

Frontend development has come a long way, and our needs are constantly evolving and increasing in complexity. Build tools are an essential part of how we build frontend applications, and existing tools are falling short of the mark sparking the development of new tools that reimagine how build tools should be designed.

With a huge focus on performance, ease of use, and less complex configuration, the next generation of build tools are poised to power ambitious frontend applications for some time to come.

Are you excited about the recent developments in this space? Let me know in the comments what you think about the upcoming innovations and the current landscape.

Further Reading on Smashing Magazine