Skip to content

Instantly share code, notes, and snippets.

/mu-plugin3.php Secret

Created December 13, 2013 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/22160578e145a67bc41a to your computer and use it in GitHub Desktop.
Save anonymous/22160578e145a67bc41a to your computer and use it in GitHub Desktop.
<?php
function wpse10691_edition_specific_categories() {
add_rewrite_rule( '(.+?)/channel/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?category_name=$matches[1]&channel=$matches[2]&feed=$matches[3]', 'top' );
add_rewrite_rule( '(.+?)/channel/(.+?)/(feed|rdf|rss|rss2|atom)/?$', 'index.php?category_name=$matches[1]&channel=$matches[2]&feed=$matches[3]', 'top' );
add_rewrite_rule( '(.+?)/channel/(.+?)/page/?([0-9]{1,})/?$', 'index.php?category_name=$matches[1]&channel=$matches[2]&paged=$matches[3]', 'top' );
add_rewrite_rule( '(.+?)/channel/(.+?)/?$', 'index.php?category_name=$matches[1]&channel=$matches[2]', 'top' );
}
add_action( 'init', 'wpse10691_edition_specific_categories' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment