Custom Menu Item with auto created Category list (5 posts)

  1. becks-star
    Posted 2 years ago #

    Hi there,
    i was searching a lot before and couldnt find what i needed.

    What i have is a custom menu (which i need to use because of the template i use).
    In this menu i want to have an item named "by category". When hovering over this item it should present an alphabetical list of all my categories.

    I know how to create a menu item and add all categories manually. But i want this menu always to have all categories automatically, even when new ones are created.

    I also know about the funtions get_categories and so on, but since i dont want to have the menu item "by category" at the end of the menu, but on place 2, meaning "between" items of the custom menu, adding this manually to the template is no option for me.

    So, how can i add a menu item with an "auto created" submenu of all my categories?

    Thanks a lot in advance

  2. Kori Ashton
    Posted 2 years ago #

    Hi Daniel - inside of WordPress widgets you should find an available widget called "Categories." This should automatically list your categories (if you have an article published in that category). It will not list the categories if there are no articles.

    Dashboard >> Appearance >> Widgets

  3. becks-star
    Posted 2 years ago #

    Hi Kori, thanks for the reply.
    The problem is, as i wrote above, i need to use the custom menu. And afaik it is not possible to add a widget to a menu as item, or am i wrong?
    Would be great if i really am, but then please let me know how to do it :)

  4. Kori Ashton
    Posted 2 years ago #

    I'm not familiar with dynamically adding categories to your main menu. What if you did a work around like this thread suggests?

    Place a page in your top menu that might say "Categories" then once they land on that page there's a dynamic list (sort of like a sitemap) visible for them to choose a category.

    Would this work?



  5. becks-star
    Posted 2 years ago #

    Well, it could be a temporary workaround, but not the final solution :)
    I will try this later.

    Maybe i will edit my theme then, so i am not forced to use the custom menu stuff.

    Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic