How to create a category menu in WordPress?

In this tutorial we’ll learn how to create a category menu in wordpress.

To do the task first you need to create some categories so go to the categories section under posts and create asmuch categories as you want. I’ve created three categories for example purpose.


Now we need to create a menu, to do this do to menu section under the appearance and create a menu. You can name it whatever you like. I’ll name it Menu 1.


Now there are three sections on left side that are pages, links and categories. Your categories will be listed under the categories section. Selct the categories you want to add and click the button add to menu. You’ll see those categories displayed under menu.


Now we need to display this menu. To display this menu we need to add following lines of code where you want display the menu.


$defaults = array(

                'theme_location' => '',

                'menu'           => '',

                'container'       => 'div',

                'container_class' => '',

                'container_id'   => '',

                'menu_class'     => 'menu',

                'menu_id'         => '',

                'echo'           => true,

                'fallback_cb'     => 'wp_page_menu',

                'before'         => '',

                'after'           => '',

                'link_before'     => '',

                'link_after'     => '',

                'items_wrap'     => '<ul id="%1$s" class="%2$s">%3$s</ul>',

                'depth'           => 0,

                'walker'         => ''


wp_nav_menu( $defaults );


Let’s say I want to display this menu in footer, so i’ll place this code in footer.php under the footer tag.

To access the footer.php file you need to go to appearance > editor. You’ll find the footer.php in the right column.

Add code then save file and refresh the page. Your menu will be displayed in footer.


Editorial Staff

ThemeLocation Provides Wordpress & Woocommerce development & Customization services. Have a Project? Contact To discuss

One thought on “How to create a category menu in WordPress?

Leave a Reply

Your email address will not be published. Required fields are marked *