• Rishi

    (@errishisolankigmailcom)


    hello
    i have created a menu using css and wordpress function .and its working fine.but i need to list down the post under a category as the second tier in the menu.
    Suppose i have 2 category and 4 post like this
    -category1
    –post1
    –post2
    category2
    –post3
    –post4
    Now I need to show the post in dropdown under the catgory.
    I have tried this code but its not working
    <ul id=”nav2″ class=”clearfloat”>

    • /” class=”on”>Home
    • <?php wp_list_categories(‘orderby=name&exlude=181&title_li=’);
      $this_category = get_category($cat);
      if (get_category_children($this_category->cat_ID) != “”) {
      echo ”

      “;
      wp_list_categories(‘orderby=id&show_count=0&title_li=&use_desc_for_title=1&child_of=’.$this_category->cat_ID);
      echo “

    “;
    }

    ?>

    Thanks in advance

  • The topic ‘list all post of a category as dropdown of a category in menu’ is closed to new replies.