Forums

[resolved] Generating category and children dropdowns (4 posts)

  1. bizarrerie
    Member
    Posted 3 months ago #

    I am sure this is simple, but I am having trouble.

    My goal is to have the categories in a navigation bar at the top. When the user hovers over the category, I would like for the children categories to appear beneath.

    So far, I have only found solutions to have the categories in a dropdown, not the method I am looking for.

    Any help?

    I just need the PHP snippet.

  2. peterjharrison
    Member
    Posted 3 months ago #

    Hi bizarrerie,

    You should be able to achieve this using the [wp_list_cats();] template tag and then using CSS.

    Good example of CSS for this would be [http://htmldog.com/articles/suckerfish/dropdowns/].

    Regards
    Pete

  3. bizarrerie
    Member
    Posted 3 months ago #

    Thanks for the reply peter. I have exhausted most of the codex pages trying to answer this question.

    I need the children to be nestled inside the ul of the category lists.

    Something similar to this:

    <ul><li>Category
    <ul class="children-cat"><li>Child Category</li>
    <li>Child Category</li>
    <li>Child Category</li></ul>
    </li></ul>

    I know the CSS to hide it, my problem is that I cannot generate this using wp_list_cats. More specific help would be appreciated!

  4. bizarrerie
    Member
    Posted 3 months ago #

    got it! Super stupid ~_~

    Thanks!

Reply

You must log in to post.

About this Topic