Forums

TwentyTen: How to get categories and sub-categories into the menu (9 posts)

  1. h-u-g-o
    Member
    Posted 1 year ago #

    Hello,

    what's the best way to get the categories and sub-categories (in their hierarchy) into the TwentyTen menu?

    I know, since WordPress 3.0 you can build your own menus, but if you have 200+ categories (please don't ask ;-)) it's not your first choice.

    Do I need to use wp_list_categories() and style it from scratch to match the TwentyTen style or is there a simpler way?

    Kind regards
    Hugo

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Don't edit the Twenty Ten theme. Your changes will be over-written the next time you upgrade WordPress or the theme. For this reason, it is recommended that you consider creating a child theme for your customisations.

  3. h-u-g-o
    Member
    Posted 1 year ago #

    Thanks for the hint, but what about the actual question?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You'd need to build a custom callback for wp_nav_menu.

  5. h-u-g-o
    Member
    Posted 1 year ago #

    Assuming that the menu should only represent the category hierarchy, how exactly has the custom callback to look like?

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Download a copy of the ZenLite theme and see how the category callback has been created in that theme.

  7. h-u-g-o
    Member
    Posted 1 year ago #

    Can't see wp_nav_menu() there.

  8. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Try looking in sidebar.php

  9. h-u-g-o
    Member
    Posted 1 year ago #

    Well, it seems to be more complicated than I hoped. :-(

Topic Closed

This topic has been closed to new replies.

About this Topic