New answers tagged

0

If other people are looking for it, here is a variation of Matthew answer (which work perfectly) to achieve this: Blog archive : /blog/ Blog category : /blog/category-name/ Blog post : /blog/category-name/post-name/ add_action( 'generate_rewrite_rules', 'add_blog_rewrites' ); function add_blog_rewrites( $wp_rewrite ) { $wp_rewrite->rules = array( ...


0

I don't know what nepal is (text prefix only or maybe taxonomy term), but it is not the most important thing, you will correct it if necessary. Rewrite rule like this should resolve the case. add_action( 'init', 'se356109_events_custom_rule' ); function se356109_events_custom_rule() { add_rewrite_rule( 'nepal/events/(.+?)/([0-9\-]+)(:?/page/?([...


0

I've fixed it with the following code: /** * Redirect '/tag/[0-9]/{tag_name}/' to the correct tag. */ add_filter('request', function($qv) { if (array_key_exists('category_name', $qv) && preg_match('/(tag\/)([0-9]*)/', $qv['category_name'])) { $qv = [ 'tag' => $qv['name'] ]; } return $qv; }); I'm not ...


Top 50 recent answers are included