How to fetch pages, categories, subcategories in WordPress menu
In this tutorial we will see how we can fetch pages, categories, subcategories in our menu and display in our WordPress website. First we need to create a custom menu in WordPress. 1. Check menu link under appearance of WordPress admin panel If the menu link is present under the appearance then you can discard the following steps. If the menu link is not present then it means that your WordPress theme does not supports custom menus. To enable custom menu support in your theme add the following code in your functions.php file present inside your theme. register_nav_menus( array( 'primary_menu' => 'Main Menu', )); The above code will add custom menu support in your WordPress theme. Now you can find menu link under appearance. 2. Create all pages, categories and subcategories in your WordPress website. Next you can create all the pages, categories and subcategories from the administrator section of the website as per your requirement. Create Pages, ...