- SEO TOOLS
- Webmaster Tools
In many cases, users want to display certain categories in WordPress menu in their main or top navigation menu. You can do this by using Custom menu. If you want to avoid using WordPress custom menu, you can do this by adding some php codes. If you use the default
wp_list_categories code, it will show all categories. So you can use the below custom category codes to create a navigation menu and only display certain categories. Add this code in your
header.php file where you want to display your certain categories.
<ul style="float:left; width:900px;"> <?php wp_list_categories('orderby=name&include=1,5,9,16,20,21,22,23'); ?> </ul>
You can design it with your own style. You can also change the include text to exclude those that you don’t want to displayed. The numbers displayed of the code are the category IDs.