Skip to content

Commit

Permalink
Merge pull request #4 from odie2/patch-2
Browse files Browse the repository at this point in the history
Great, this will help with translation of the /page/ URL slug.
  • Loading branch information
foliovision committed May 22, 2015
2 parents 0387e5a + f35217d commit ee01088
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions top-level-cats.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ function fv_top_level_categories_rewrite_rules($category_rewrite) {
$pages_urls[] = trim( str_replace( get_bloginfo( 'url' ), '', get_permalink( $pages_item->ID ) ), '/' );
}
///

global $wp_rewrite;

$category_rewrite=array();
$categories=get_categories(array('hide_empty'=>false));
foreach($categories as $category) {
Expand All @@ -68,11 +69,10 @@ function fv_top_level_categories_rewrite_rules($category_rewrite) {


$category_rewrite['('.$category_nicename.')/(?:feed/)?(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
$category_rewrite['('.$category_nicename.')/page/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]';
$category_rewrite['('.$category_nicename.')/'. $wp_rewrite->pagination_base .'/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]';
$category_rewrite['('.$category_nicename.')/?$'] = 'index.php?category_name=$matches[1]';
}
// Redirect support from Old Category Base
global $wp_rewrite;
$old_category_base = get_option('category_base') ? get_option('category_base') : 'category';
$old_category_base = trim($old_category_base, '/');
$category_rewrite[$old_category_base.'/(.*)$'] = 'index.php?category_redirect=$matches[1]';
Expand Down

0 comments on commit ee01088

Please sign in to comment.