Forums

[resolved] navbar categories and child_of (5 posts)

  1. drinkin_park
    Member
    Posted 3 years ago #

    hello,

    i'm trying to convert my categories to drop dawn menu (http://javascript-arraydotcom/scripts/simple_drop_down_menu/), but i need to separate the categories from their child categories. I read the 'template Tags/wp list categories' couple of times, trying to figure how this might happen, but i still can't find the solution. Can somebody help me?

  2. stvwlf
    Member
    Posted 3 years ago #

    Hi

    I doubt you need to separate child and parent categories - wp_list_categories can create the output the way you need it. It creates the child lists under the top level list items.

    The way to think of it is you are taking the vertical list of categories that typically displays in the sidebar, and display the same thing horizontally. You don't need javascript for that (except in IE6). This technique is done more often with pages, but its the exact same principle.

    The solution is CSS. CSS turns the LI items that normally display vertically into a horizontal list. This is accomplished by adding either display:inline or float:left to the nav LI items - either will work.

    There is a good Codex page on this subject
    http://codex.wordpress.org/Creating_Horizontal_Menus

  3. drinkin_park
    Member
    Posted 3 years ago #

    okay, i'm gonna try this. Btw, the Java Script is for some effects, actually the drop dawn menu is built by CSS and HTML.

    Many thanks, stvwlf, i much appreciate your help.

  4. drinkin_park
    Member
    Posted 3 years ago #

    now, it's not working and i think you didn't understand my idea. I want to make a drop dawn menu, now it's almost drop dawn - there is a parent category and below it there is a child of it and they are listed all inline... I'm gonna take a screen shot because i doubt i can explain this correctly
    <img src="http://lyrics2bg.com/L2BG_tools/001.jpg">
    i will use a less complex image ...
    <img src="http://lyrics2bg.com/L2BG_tools/002.jpg">
    so you see *Metalcore - this should be the title of a drop dawn menu and "All That Remains" and "Bullet for my Valentine" - it's sub elements. If there is one more category after *Metalcore, it will be displayed when al sub elements of previous category are listed. So, you see in the first picture what a big mess happens :)

  5. drinkin_park
    Member
    Posted 3 years ago #

    okay, i found this nice plug-in (PixoPoint Multi-level Navigation Plugin) and install it, it fits my needs perfectly (for now) and i will close this topic (making it 'resolved'). Thanks to stvwlf for his reply, i appreciate it.

Topic Closed

This topic has been closed to new replies.

About this Topic