I have archive pages and single pages running good, I would need custom pages inside them too. For example, www.site.com/dates
is archive page, and www.site.com/dates/product1
is single page. I would need pages for months too, so www.site.com/dates/january
, www.site.com/dates/february
etc. should be working.
$months = array('january', 'february', 'march', ...);
$args = array(
'labels' => array(
'name' => 'Dates',
),
'rewrite' => array(
'slug' => 'dates'
),
'public' => true,
'publicly_queryable' => true,
'has_archive' => true,
'supports' => array('title', 'excerpt')
);
register_post_type('date-posttype', $args);
foreach(months as $month)
{
$args = array(
'labels' => array('name' => $month),
'hierarchical' => true,
'sort' => true,
'query_var' => $month_var
);
register_taxonomy($month_var, 'date-posttype', $args);
}
I can probably get with custom code for showing data when these months pages are working, but how do I get them to work?