archives-for-custom-post-types
archives-for-custom-post-types copied to clipboard
Post type before archive
Hello jacklenox, how do I come before my post_type of the archive?
Ex: http://yoursite.com/{custom-post-type}/2014
Thanks!
I was able to do this by rearranging the rewrite rules:
$newrules['(' . $line_separated . ')/(\d*)$'] = 'index.php?post_type=$matches[1]&m=$matches[2]';
$newrules['(' . $line_separated . ')/(\d*)/(\d*)$'] = 'index.php?post_type=$matches[1]&m=$matches[2]$matches[3]';
$newrules['(' . $line_separated . ')/(\d*)/(\d*)/(\d*)$'] = 'index.php?post_type=$matches[1]&m=$matches[2]$matches[3]$matches[4]';
$newrules['(' . $line_separated . ')/(\d*)/page/(\d*)$'] = 'index.php?post_type=$matches[1]&m=$matches[2]&paged=$matches[3]';
$newrules['(' . $line_separated . ')/(\d*)/(\d*)/page/(\d*)$'] = 'index.php?post_type=$matches[1]&m=$matches[2]$matches[3]&paged=$matches[4]';
$newrules['(' . $line_separated . ')/(\d*)/(\d*)/(\d*)/page/(\d*)$'] = 'index.php?post_type=$matches[1]&m=$matches[2]$matches[3]$matches[4]&paged=$matches[5]';