Monday, November 7, 2022

How to Add Custom Navigation Menus in WordPress Themes

Do you want to add custom navigation menus in your WordPress theme?

All themes have set locations where you can display a navigation menu. However, by default, you can’t add a menu anywhere else except these pre-defined locations.

In this article, we’ll show you how to add a custom navigation menu to any area of your WordPress theme.

How to add custom navigation menus in WordPress themes

Why Add Custom Navigation Menus in WordPress Themes?

A navigation menu is a list of links pointing to important areas of your website. They make it easy for visitors to find interesting content, which can increase pageviews and reduce bounce rate in WordPress.

The exact location of your menu will vary based on your WordPress theme. Most themes have several options, so you can create different menus and show them in different places.

To see where you can display menus in your current WordPress theme, simply head over to Appearance » Menus and then take a look at the ‘Display location’ section.

The following image shows the locations that are supported by the Astra WordPress Theme.

The menu locations in the popular Astra theme

However, sometimes you may want to show a menu in an area that isn’t listed as a ‘Display location’ in your theme.

With that in mind, let’s take a look at how to create WordPress navigation menus and then add them to your theme. Simply use the quick links below to jump to the method you prefer.

Method 1. Adding a Custom Navigation Menu in Full Site Editing

If you’re using a block theme, then you can add a custom navigation menu using Full Site Editing (FSE) and the block editor. For more details, you can see our article on the best WordPress full-site editing themes.

This method doesn’t work with every theme, and it doesn’t let you customize every part of the menu. If you want to add a completely custom menu to any WordPress theme, then we recommend using a page builder plugin.

If you are using a block-based theme, then head over to Appearance » Editor.

How to launch the FSE

This will launch the full site editor with one of your active theme’s templates already selected.

If you want to add a custom navigation menu to a different template, then click on the arrow in the toolbar and select ‘Browse all templates.’

Changing templates in the Full Site Editor

The site editor will now show all the different templates that are part of your theme.

Simply find the template that you want to edit, and give it a click.

Switching templates in the block-based FSE

The next step is adding a Navigation block to the area where you want to show your menu.

In the top-left corner, click on the blue ‘+’ button.

Adding blocks to your WordPress theme

Now, go ahead and type ‘Navigation’ into the search bar.

When the ‘Navigation’ block appears, simply drag and drop it onto your layout.

The WordPress Navigation block

Next, click to select the Navigation block.

If you’ve already created the menu that you want to display, then click ‘Select Menu’ and make your selection from the dropdown.

Adding a custom navigation menu using FSE

Another option is to click on ‘Create new menu,’ which allows you to build a navigation menu inside the full site editor.

To start with a blank menu, simply click on ‘Start empty.’

Building a menu in the WordPress full site editor

To add items to the new menu, just click on the ‘+’ icon.

This opens a popup where you add any post or page, and decide whether these links should open in a new tab.

How to build a new menu in the block editor

Simply repeat these steps to add more items to the menu.

When you’re happy with how the menu looks, simply click on the ‘Save’ button. Your site will now be using the new template, and visitors can interact with your custom navigation menu.

Method 2. Creating a Custom Navigation Menu in WordPress Using SeedProd (Works With All Themes)

The full site editor is a quick and easy way to add a basic custom menu to block-based themes. However, if you want to add an advanced, fully-customizable menu to any theme, then you’ll need a page builder plugin.

SeedProd is the best WordPress page builder plugin on the market and allows you to customize every part of your navigation menu.

SeedProd comes with over 180 professionally-designed templates that you can use as your starting point. After choosing a template, you can add a custom navigation menu to your site using simple drag and drop.

First, you need to install and activate the SeedProd plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Note: There’s also a free version of SeedProd that allows you to create custom navigation menus without writing code. However, in this guide, we’ll be using SeedProd Pro since it has lots more templates for you to choose from.

After activating the plugin, SeedProd will ask for your license key.

SeedProd license key

You can find this information under your account on the SeedProd website. After entering the key, click on the ‘Verify Key’ button.

Once you’ve done that, go to SeedProd » Landing Pages and click on the ‘Add New Landing Page’ button.

SeedProd's page design templates

You can now choose a template for your custom page.

To help you find the right design, all of SeedProd’s templates are organized into different campaign types such as coming soon and lead squeeze campaigns. You can even use SeedProd’s templates to improve your 404 page.

The SeedProd template library

To take a closer look at any design, simply hover your mouse over that template and then click on the magnifying glass icon.

When you find a design that you want to use, click on ‘Choose This Template.’

Choosing a SeedProd template for your WordPress website

We’re using the ‘Black Friday Sales Page’ template in all our images, but you can use any template you want.

After choosing a template, type in a name for that custom page. SeedProd will automatically create a URL based on the page’s title, but you can change this URL to anything you want.

After entering this information, click on the ‘Save and Start Editing the Page’ button.

Creating a new page using SeedProd

Most templates already contain some blocks, which are the core components of all SeedProd page layouts.

To customize a block, just click to select it in the page editor.

The left-hand toolbar will then show all the settings for that block. For example, in the image below, we’re changing the text inside a ‘Headline’ block.

Editing a headline in SeedProd

You can format the text, change its alignment, add links, and more using the settings in the left-hand menu.

To add new blocks to your design, simply find any block in the left-hand menu and then drag it onto your design. If you want to delete a block, then simply click to select that block and then click on the trash can icon.

Removing blocks from a custom layout

Since we want to create a custom navigation menu, drag a ‘Nav Menu’ block onto the page.

This creates a navigation menu with a single default ‘About’ item.

Adding a custom navigation menu to a WordPress layout

To customize this menu item, click to select it in the left-hand menu.

This opens some controls where you can change the text, as well as add the URL for the menu item to link to.

Adding a custom navigation menu to a landing page

By default, the menu item will be a ‘dofollow’ link and open in the same browser window. To change either of these settings, simply use the checkboxes in the ‘URL Link’ section.

In the following image, we’re creating a “nofollow” link that will open in a new window.

Marking a menu item as no-follow

To add more items to the menu, simply click on the ‘Add New Item’ button.

You can then customize each of these items by following the same process described above.

Adding items to a custom navigation menu

The left-hand menu also has settings that change the font size and text alignment.

You can even create a divider, which will appear between each item in the menu.

Creating a divider for your custom navigation menu

After that, go ahead and switch to the ‘Advanced’ tab. Here, you can change the menu’s colors, spacing, typography, and other advanced options.

As you make changes, the live preview will update automatically so you can try different settings to see what looks good in your design.

The SeedProd advanced customization settings

When you’re happy with how the custom menu looks, it’s time to publish it.

Simply click the dropdown arrow next to ‘Save’ and then select ‘Publish.’

How to publish a custom page layout

Your custom navigation menu and the page will now go live on your WordPress blog.

Method 3. Creating a Custom Navigation Menu in WordPress Using Code (Advanced)

If you don’t want to set up a page builder plugin, then you can add a custom navigation menu using code. Normally, you would need to add custom code snippets to your theme’s functions.php file.

However, we don’t recommend this method for anyone but advanced users, and even then, a small mistake in your code could cause a number of common WordPress errors, or break your site completely.

That’s why we recommend using WPCode. It is the easiest and safest way to add custom code in WordPress without having to edit any core WordPress files.

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

Upon activation, go to Code Snippets » Add Snippet in your WordPress dashboard.

Adding a code snippet using the WPCode WordPress plugin

Here, you’ll see all of the different ready-made snippets that you can add to your site.

Since we want to add our own snippet, hover your mouse over ‘Add Your Custom Code,’ and then click ‘Use snippet.’

Adding a custom snippet to your WordPress website

To start, enter a title for the custom code snippet. This can be anything that helps you identify the snippet.

After that, open the ‘Code Type’ dropdown and select ‘PHP Snippet.’

Adding a custom navigation menu using WPCode

Once you’ve done that, simply paste the following snippet into the code editor:

function wpb_custom_new_menu() {
  register_nav_menu('my-custom-menu',__( 'My Custom Menu' ));
}
add_action( 'init', 'wpb_custom_new_menu' );

This will add a new menu location to your theme, called ‘My Custom Menu.’ To use a different name, simply change the above code snippet.

If you want to add more than one new navigation menu to your theme, then simply add an extra line to your code snippet. For example, here we’re adding two new menu locations to our theme, called My Custom Menu and Extra Menu:

function wpb_custom_new_menu() {
  register_nav_menus(
    array(
      'my-custom-menu' => __( 'My Custom Menu' ),
      'extra-menu' => __( 'Extra Menu' )
    )
  );
}
add_action( 'init', 'wpb_custom_new_menu' );

Below the code box, you will see insertion options. If it isn’t already selected, then choose the ‘Auto Insert’ method so the snippet will be automatically inserted and executed on your site.

After that, open the ‘Location’ dropdown and click on ‘Run Everywhere.’

Running a custom code snippet

Then, you’re ready to scroll to the top of the screen and click on the ‘Inactive’ toggle so it changes to ‘Active.’

Finally, go ahead and click on ‘Save’ to make this snippet live.

Inserting a custom navigation menu using the WPCode WordPress plugin

After that, go to Appearance » Menus and look at the ‘Display location’ area.

You should now see a new ‘My Custom Menu’ option.

A custom navigation menu created using the WPCode plugin

You’re now ready to add some menu items to the new location. For more information, please see our step-by-step guide on how to add navigation menus for beginners.

When you’re happy with your menu, the next step is adding it to your WordPress theme.

Adding the custom navigation menu to your WordPress theme

Most website owners show their navigation menu directly under the header section just after the site logo or title. This means the navigation menu is the first thing visitors see.

However, you can display your custom navigation menu anywhere you want by adding some code to the theme’s template file.

In your WordPress dashboard, go to Appearance » Theme File Editor.

In the right-hand menu, select the template that you want to edit. For example, if you want to show the custom navigation menu in your website’s header, then you’ll typically want to select the header.php file.

The WordPress theme file editor

For help finding the right template file, please see our guide on how to find which files to edit in your WordPress theme.

After selecting the template file, you need to add a wp_nav_menu function and specify the name of your custom menu. For example, in the following code snippet we’re adding My Custom Menu to the theme’s header:

wp_nav_menu( array( 'theme_location'=>'my-custom-menu', 'container_class'=>'custom-menu-class' ) );

After adding the code, click on the ‘Update File’ button to save your changes.

Editing the WordPress theme files

Now if you visit your site, you’ll see the custom menu in action.

By default, your menu will appear as a plain bulleted list.

A custom WordPress menu created using code

You can style the custom navigation menu to better match your WordPress theme or company branding by adding custom CSS code to your site.

To do this, go to Appearance » Customize.

Customizing a WordPress theme

In the WordPress customizer, click on ‘Additional CSS.’

This opens a small code editor where you can type in some CSS.

Adding additional CSS to your WordPress theme

You can now style your menu using the CSS class that you added to your theme template. In our example, this is .custom_menu_class.

In the following code, we’re adding margins and padding, setting the text color to black, and arranging the menu items in a horizontal layout:

div.custom-menu-class ul {
    margin:20px 0px 20px 0px;
    list-style-type: none;
    list-style: none;
    list-style-image: none;
    text-align:right;
        display:inline-block;
}
div.custom-menu-class li {
    padding: 0px 20px 0px 0px;
    display: inline-block;
} 

div.custom-menu-class a {
    color:#000;
}

The WordPress customizer will update automatically to show how the menu will look with the new style.

Styling a custom navigation menu

If you’re happy with how the menu looks, then click on ‘Publish’ to make your changes live.

For more information, please see our guide on how to style WordPress navigation menus.

Do More With WordPress Navigation Menus

With WordPress, you can do much more than just show links in a menu. Here’s how to get even more out of your navigation menus:

We hope this ultimate guide helped you learn how to add a custom navigation menu in WordPress. You may also want to see the best ways to increase your blog traffic and how to track website visitors to your WordPress site.

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 Add Custom Navigation Menus in WordPress Themes first appeared on WPBeginner.


November 08, 2022 at 12:46AM

How To Buy a Domain Name Anonymously (3 Easy Ways)

Do you want to buy a domain main anonymously for your business?

When you purchase a domain, your personal information is listed in the WHOIS database which is publicly available. Because of that, anyone can search and see who owns the domain.

In this article, we’ll show you how to buy a domain name anonymously.

How to buy a domain name anonymously

Why Buy a Domain Name Anonymously?

When you create a WordPress website, you’ll need a domain name. It is your site’s address that people will type in their browsers to visit your website.

However, when you buy a domain name, your personal information is saved in a public WHOIS database. The Internet Corporation for Assigned Names and Numbers, or ICANN, requires every domain registrar to maintain a WHOIS database.

Using this database, anyone can find out who actually owns a domain name. This includes your name, email address, physical address, server name, DNS, and other information.

WHOIS database

Buying a domain anonymously allows you to protect your private data and use proxy information in the WHOIS database instead. Plus, you can prevent malicious or accidental domain transfers from happening.

Additionally, getting the domain anonymously enhances your site’s online security. It prevents hackers from stealing your domain or misusing it for monetary benefit.

That said, let’s look at how you can buy a domain name anonymously. We’ll show you 3 ways to hide your information in the WHOIS database using domain registrars and a web hosting company.

You can click the links below to jump ahead to your preferred section:

Method 1: Buy Domain Name Anonymously Using Domain.com

Domain.com is one of the most popular domain name registrars. You can easily find a domain for your website, as it offers more than 300 website name extensions.

With Domain.com, you get access to multiple tools for domain management. For example, you get bulk registration, easy transfers, DNS management, an email account, and more.

To buy a domain name anonymously, you’ll first need to visit the Domain.com website and enter a name in the search bar. After that, simply click the ‘Search’ button.

The Domain.com website with search bar

The domain registrar will now see if the domain you’re looking for is available and show a list of options with different website extensions.

If your domain is available, then Domain.com will add the ‘Domain Privacy + Protection’ addon by default. However, this is a paid addon and will cost you an additional $8.99 per year along with the cost of the domain name.

You will see it in your shopping cart, and the ‘Add Domain Privacy + Protection to each domain for $8.99 per year’ option will also be enabled.

Add domain privacy and protection feature

Domain.com offers WPBeignner readers 25% off on domains and addons like Privacy + Protection.

All you have to do is use the Domain.com coupon code at checkout.

Method 2: Buy Domain Name Anonymously Using Bluehost

Bluehost is one of the largest hosting companies in the world and the official WordPress hosting partner. When you sign up for their hosting service, you can register a domain for free.

Bluehost lets you add the ‘Domain Privacy Protection’ addon to your package during the signup process. This way, your private information won’t be publically available, as it will be replaced with generic Bluehost contact details in the WHOIS database.

Bluehost offers an exclusive discount for WPBeginner users. Using the Bluehost coupon code, you can get website hosting, a free domain name, and a free SSL certificate for just $2.75 per month.

To get started, you need to visit the Bluehost website and click the ‘Get Started Now’ button.

Bluehost website

Next, you will need to select a pricing plan.

Simply click the ‘Select’ button for any plan you’d like to use.

Bluehost pricing plans

After that, Bluehost will ask you to set up a domain. You can either create a new domain or connect an existing domain name.

Since we’re buying a new domain, simply enter a name under the ‘Create a new domain’ section and click the ‘Next’ button. You can also choose the domain extension you’d like to use.

Enter your domain name

Bluehost will now check if the domain name you entered is available. If it is, then you’ll see the account information and payment page.

Next, you can add your personal details to create an account. From here, simply scroll down to the ‘Package Extras’ section and make sure that the ‘Domain Privacy + Protection’ addon is selected.

Ensure that domain privacy is added

The ‘Domain Privacy + Protection’ costs $11.88 per year at Bluehost. With that option selected, you can go ahead and enter your payment details to purchase website hosting and domain name anonymously.

Method 3: Buy Domain Name Anonymously Using GoDaddy

Another way you can get your hands on a domain name anonymously is by using GoDaddy. It is one of the oldest and most popular domain registrars in the market.

To start, you can visit the GoDaddy website and search for a domain name.

Search for domain name in GoDaddy

Next, GoDaddy will check and see if your domain name is available. It will also show different domain extensions you can purchase along with the .com extension.

After that, simply click the ‘Continue to Cart’ button.

Continue to cart

On the next screen, you can select different addons for your domain name. This includes protecting your domain and keeping your information anonymous.

Simply select the ‘Full Domain Protection’ option, which is $9.99 per year, and click the ‘Continue to Cart’ button.

Select full domain protection

After that, GoDaddy will show you a summary of your cart. You can check if everything is correct.

Next, go ahead and click the ‘I’m Ready to Pay’ button to proceed to the payment process and finalize your purchase.

View cart summary

Additionally, GoDaddy differs from other registrars because you can buy a domain name that’s already taken by using their domain broker service.

If the domain name you’re looking for is owned by someone else, then GoDaddy will work as a broker and try to work out a deal with the domain owner.

Since GoDaddy acts as the middleman and handles all the steps, your identity is never revealed to the actual owner.

Simply visit the GoDaddy Domain Broker Service webpage and enter the domain name in the search bar.

Domain broker service

Next, you can hire GoDaddy as your domain broker, so they can negotiate a deal to purchase your domain name.

Doing so and using GoDaddy as a broker will cost you $69.99 per domain plus a 20% commission on the final price of the domain.

Hire a broker

We hope this article helped you learn how to buy a domain name anonymously. You can also see our guide on how to improve your WordPress SEO ranking, and the best email marketing services for small businesses.

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 Buy a Domain Name Anonymously (3 Easy Ways) first appeared on WPBeginner.


November 07, 2022 at 04:13PM

Sunday, November 6, 2022

How to Add WordPress Reaction Buttons to Boost Engagement

Are you looking to improve user engagement on your website?

Having reaction buttons on your WordPress site gives your readers a simple and easy way to leave feedback on your blog without having to type a comment.

In this article, we will show you how to add reaction buttons in WordPress.

How to Add WordPress Reaction Buttons to Boost Engagement

Why Add Reaction Buttons in WordPress?

Reaction buttons help you boost user engagement on your WordPress blog. because not all users have the time or confidence to leave a comment.

That’s why popular social media websites like Facebook use Like and other Reaction buttons to boost engagement. You can also add a Facebook Like button to your posts.

Facebook Lets Users React to Posts With the Like Button

You can encourage more interaction on your site by adding WordPress reaction buttons. These allow your users to engage with your post with just a click.

With that being said, let’s take a look at how to add this kind of reaction button to your WordPress site.

How to Add Reaction Buttons in WordPress

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

For this tutorial, we’ll use the free version of the plugin. There is also a premium version, WP Reactions, which adds additional features such as buttons for more social platforms.

Upon activation, head over to WP Reactions » Global Activation to configure the plugin. Once there, you need to toggle the ‘Reactions’ switch to the ON position.

Toggle the Reactions Switch to the ON Position

WordPress reaction buttons will now be displayed at the bottom of each post and page. You can customize various reaction options by clicking the ‘Customize Now’ button and using the WP Reactions setup wizard.

Customizing Your WordPress Reaction Buttons

The default settings of the WP Reactions plugin will work for most WordPress websites. However, there are still many ways to customize them to suit your needs.

First, you will see the 7 default emojis at the bottom of the screen. You can rearrange or replace the emojis by dragging and dropping them. When an emoji is highlighted blue, that means it’s already included.

Choose the Emojis to Add to Your Posts

When you are happy with your reaction button selection, click the ‘Next’ button at the bottom.

On the next page, you can choose the size of the emojis and whether to animate them. You can also choose the color of the badges that show how many times users have clicked on each reaction.

Pro users can disable these badges altogether.

Set Up Your Reaction Buttons

Now you can decide where to place the reaction buttons using the settings at the bottom of the screen. They can appear on posts, pages, or both, and you can display them before or after the content. You can also select if they will be left-, center-, or right-aligned.

When you are happy with your selections, just click the ‘Next’ button.

You can now choose the styling for the call to action (CTA), background, and border. By default, the words ‘What’s your Reaction?’ will appear above the buttons. You can change or hide this text, as well as adjust the font options.

Style Your Reaction Buttons

You can click the ‘Next’ button when you’re finished.

On the following page, you will configure the optional social share buttons. There are options to show buttons for Facebook, Twitter, Email, and Telegram. Pro users have even more options like LinkedIn and WhatsApp.

Set Up Social Share Buttons

By default, the plugin will show these social share buttons after the user clicks a reaction button. You can change or disable this setting under the ‘Button Behavior’ section.

As you scroll down the page, you will find options to customize the size and color of the social share buttons. Make sure you press the ‘Next’ button when you are ready.

Save Your Settings

Congratulations, you have now successfully configured your WordPress reaction buttons. Make sure you click the ‘Save & Exit’ button to store your settings.

Previewing Your WordPress Reaction Buttons

You can now visit any post on your website to see the reaction buttons in action. This is how it looks on our demo website using the default settings.

WordPress Reaction Buttons Preview

When you click one of the reaction buttons, its badge will be updated with a new total.

Notice that since we clicked an emoji, the social share buttons are now displayed under the WordPress reaction buttons.

WordPress Reaction Buttons Preview When Clicked

We hope this tutorial helped you learn how to add WordPress reaction buttons to boost engagement on your site. You may also want to learn how to add keywords and meta descriptions or check out our list of the best social media plugins for WordPress.

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 Add WordPress Reaction Buttons to Boost Engagement first appeared on WPBeginner.


November 06, 2022 at 06:01PM