WordPress.org

Ready to get started?Download WordPress

Forums

Custom menu by category and publish date (1 post)

  1. aligregory14
    Member
    Posted 2 years ago #

    In short, what I am trying to achieve is a custom, hierarchical menu of posts, first by category (driven by taxonomy) and then by their post_date.
    I anticipate my menu looking something like this:

    - Category 1
    - 2011
    - March
    - May
    - December
    -2012
    -January
    -May
    - Category 2
    - 2011
    - February
    - April

    I have the first part working, displaying a menu entry for each taxonomy type using wp_list_categories. The code is as follows:

    $taxonomy = 'log-category';
    $orderby = 'date';
    $show_count = 1;
    $pad_counts = 0;
    $hierachical = 1;
    $title = '';
    
    	$cat_args = array(
    
    		'taxonomy' => $taxonomy,
    		'oderby' => $orderby,
    		'show_count' => $show_count,
    		'pad_counts' => $pad_counts,
    		'hierachical' => $hiereachical,
    		'title_li' => $title
    		);
    ?>
    <ul>
    <?php wp_list_categories($cat_args);
     ?>
    </ul>
    </li>

    My question is, how can I add the sub categories of 'year' and 'month' to my custom menu? The post_date data is inputed via the normal out-the-box metabox on the admin screen. The posts I am wishing to build the menu for are from a custom post type called 'swp_disclosurelog'.

    Thanks in anticipation of your help.

Topic Closed

This topic has been closed to new replies.

About this Topic