Viewing 2 replies - 1 through 2 (of 2 total)
  • roshansachan

    (@roshansachan)

    Hey johanthomasbrolin,
    Did you find any solution? I am looking for the same url structure. It would really help me if you can share the solution.
    Thank you.

    roshansachan

    (@roshansachan)

    Hey johanthomasbrolin,

    I found a solution to our problem:

    1. To change the url in the folowing format – domain.com/custom-post-type/2015/03.
      change the line where the url is constructed like this

      $url= get_site_url() .'/' .$post_type .$result->year .'/'.sprintf("%02d", $result->month );

    2. chnages in rewrite rule:

      $newrules['(\d*)/(' . $line_separated . ')$'] = 'index.php?m=$matches[1]&post_type=$matches[2]';

      $newrules['(' . $line_separated . ')/(\d*)/(\d*)/page/(\d*)$'] = 'index.php?post_type=$matches[1]&m=$matches[2]$matches[3]&paged=$matches[4]';

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change permalink structure REVISITED’ is closed to new replies.