Forums

Displaying posts from a category in the menu (2 posts)

  1. johnba
    Member
    Posted 2 years ago #

    Hello,

    I'm having the following issue :
    In my main menu (Home , About etc ) I want to add the "Products" Category with its subcategories (e.g : Product Subcat 1 , Product Subcat 2 etc) . When I hover over the Subcategories , I want it to display the posts from that category ( Products ---> Product Subcat1 ---> Post 1 , Post 2 , Post 3 ) .

    Is that possible?

    Thank You
    John

  2. Frumph
    Member
    Posted 2 years ago #

    If you're using wp_list_pages() to display the menubar dynamically you can do &depth=#

    which will then go 'as many levels deep' as you need to go to display from parent-child relationships with pages.

    for example:

    wp_list_pages('sort_column=menu_order&depth=4&title_li=');

    This says sort the column_menu by menu_order with a depth of 4, and with no title_li

    That means that it will take the parent pages and display 4 levels deep in relationship

    Parent
      -  Child
         - Child 2
            - child 3
              - child 4

    So depth is how many different parent-child relationships you want it to display.

    You can then edit your CSS to recognize the li under the
    ul's and make it display how you want to with dropdown sidescroll whatever.

Topic Closed

This topic has been closed to new replies.

About this Topic