Skip to content

Instantly share code, notes, and snippets.

@nielsvr
Last active March 10, 2020 06:29
Show Gist options
  • Save nielsvr/761ed543d16b32a068e52b0ea1cc39c4 to your computer and use it in GitHub Desktop.
Save nielsvr/761ed543d16b32a068e52b0ea1cc39c4 to your computer and use it in GitHub Desktop.
Rewrite
<?php
// Should match /category/s/
// Should match /category/tag/s/
// Should match /category/tag/tag/s/
// Etcetera
// https://regex101.com/r/sNfHex/1
add_rewrite_rule("^(.*)\/[s]\/?", "index.php?category_name=$matches[1]", 'top');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment