Once you have created a menu, you can display it on your website by assigning it to an available location. The available locations are determined by the theme used. WordPress themes include various integrated menu locations, where you can assign menus.
To assign a location to a menu using WP-CLI to display it on your WordPress website, we recommend that you follow the instructions below.
We will use the wp menu location subcommand to list the available locations for the menus.
- Log in to the server via SSH with the cPanel user who owns the website you want to work on.
- Use the cd command to access the root folder of your website, eg:
cd public_html/wp
Replace public_html/wp with the actual path to the root folder of your website.
Execute the following command:
wp menu location assign primary-nav top
Replace primary-nav with your menu name and top with your location name.
The above command will return an output similar to:
[email protected] [~/public_html/wp]# wp menu location assign primary-nav top Success: Assigned location to menu.
For assistance in applying the above instructions on HostX servers please contact us. HostX offers the fastest WordPress hosting and can help you solve your problems.
