archives-for-custom-post-types icon indicating copy to clipboard operation
archives-for-custom-post-types copied to clipboard

Post type before archive

Open eliasfaical opened this issue 10 years ago • 1 comments

Hello jacklenox, how do I come before my post_type of the archive?

Ex: http://yoursite.com/{custom-post-type}/2014

Thanks!

eliasfaical avatar Nov 27 '14 16:11 eliasfaical

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]';

strickdj avatar Mar 31 '15 20:03 strickdj