How to Edit the Top Bar on a WordPress Website

The top bar is the area above the fold (or the first bit of content) on a webpage. It’s often made up of a brand’s logo, social media buttons, and a search bar, but can be designed to be more feature-rich.

Here’s a quick how-to guide on how to edit the top bar on a WordPress website.

Getting Started

The first thing you need to do is log in to your WordPress dashboard. If you haven’t done so already, click the logo in the top left corner to go to your WordPress dashboard.

From your dashboard, click on the Settings icon in the upper-right corner and select the General tab.

Then, navigate to the Top Bar section and click on the Edit button.

A modal dialog will pop up where you can configure the top bar for your site.

The Basics

The basics of your top bar can be found on the General Settings page where you can configure the display order, remove unneeded links, and define the type of content that will show up when user clicks on the homepage link.

For example, if your homepage is going to be a blog post, the Top Bar Settings page will have a section labelled Blog. Here, you can define what should show up when a user clicks on the Blog link on your site’s homepage.

The display order of your top bar is going to be the order in which the items are presented in your content. For example, if you have a logo, social media buttons, and a search bar, your homepage will have the search bar at the top followed by your logo and social media buttons.

You can also remove entries from your top bar that you don’t want to display or define new links to include.

Another important feature of your top bar is the type of content that will show up when a user clicks on it. We’ll discuss what these options mean in detail below.

Alignment

The first thing you’ll want to do is decide whether you want your brand’s logo or the navigation menu to be aligned with the top bar. You can also decide whether you want the search bar to be aligned with the logo or the navigation menu.

If you go with the logo first, followed by the navigation menu, the search bar will be aligned with the logo. If you go with the navigation menu first, followed by the logo, the search bar will be aligned with the navigation menu. In both of these cases, the top bar will be aligned to the right.

You can’t use HTML to change the alignment of your top bar. You’ll need to use a CSS file. To continue with our example, if your website’s theme is called “Professional,” you can use the following code to change the alignment of your top bar:

<style type=”text/css”>

#my-top-nav {

float: none;

margin: 0;

padding: 0;

text-align: center;

}

</style>

#my-logo {

margin: 0;

padding: 0;

float: none;

align-self: center;

}

<img src=”https://www.example.com/wp-content/uploads/2018/09/logo.png” width=”200″ alt=”Example.com”/>

<h2>Buttons

The next thing to consider is what type of buttons you want to use in your top bar. The default style for WordPress’ top bar is the “button” type. This means that when a user clicks on it, they’ll be taken to a different website, landing page, or whatever you want to call it. But you can change this behavior using the following code:

<style type=”text/css”>

#my-top-nav {

float: none;

margin: 0;

padding: 0;

text-align: center;

}

</style>

#my-logo {

margin: 0;

padding: 0;

float: none;

align-self: center;

}

<img src=”https://www.example.com/wp-content/uploads/2018/09/logo.png” width=”200″ alt=”Example.com”/>

<h2>Search Bar

Depending on your site’s purpose, you may also want to add a search bar to your top bar. If your site focuses on products, you might not want to include a search bar as it might interrupt the flow of the content above it. However, if your site’s purpose is to find information, you can use the search bar to your advantage. Your decision to add or remove a search bar from your top bar should be based on your site’s purpose.

To help you decide where to put the search bar on your site, we’re going to use the Google Search bar. Since we have the Google Search bar in our browser’s toolbar, we can click on it to get a new browser window with Google’s search results.

On the Search Results page, we can see that there’s a Featured Snippet at the top that has a headless (and very minimal) card with a rounded corner on it. This is the area below the Search bar that we’ll be editing to put our logo, social media buttons, and search results here. The headless (and minimal) card is a good place to start.

Since we’re using the headless (and minimal) card as a guide, let’s drag it below the Google Search bar and click on the Edit button.

A small dialog will appear where you can configure the headless (and minimal) card.

Customizing The Headless Card

The first thing you’ll want to do is click on the Customize button at the top-left of the dialog. This will allow you to change the appearance of the headless card. You can choose from a variety of backgrounds and add a menu to the far-left side of the card using the following code:

<style type=”text/css”>

#my-top-nav {

float: none;

margin: 0;

padding: 0;

text-align: center;

}

</style>

#my-logo {

margin: 0;

padding: 0;

float: none;

align-self: center;

}

<img src=”https://www.example.com/wp-content/uploads/2018/09/logo.png” width=”200″ alt=”Example.com”/>

<h2>Adding Social Media Buttons

Next, let’s add our social media buttons to our headless card. Since we already have the Google Search bar in our headless card, we can simply paste the

  • element from our navigation menu into the
      below it. This ensures that our social media buttons will always be aligned with the Search bar and logo.