Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter vsandvold

    (@vsandvold)

    So far I tried the following, without getting what I want:

    add_filter('rewrite_rules_array', 'my_rewrite');
    function my_rewrite($rewrite) {
    	global $wp_rewrite;
    
       	$category_rules = array(
            	'concerts/' => 'category/concerts/',
            	'venues/' => 'category/venues/'
        	);
    
    	$concert_post_structure = $wp_rewrite->root . "concerts/%year%/%monthnum%/%day%/%postname%/";
    	$venue_post_structure   = $wp_rewrite->root . "venues/%postname%/";
    
    	return ( $rewrite
    		+ $category_rules
    		+ $wp_rewrite->generate_rewrite_rules($concert_post_structure)
    		+ $wp_rewrite->generate_rewrite_rules($venue_post_structure)
    	);
    }

    Thread Starter vsandvold

    (@vsandvold)

    What I get is this:
    * concerts/ and venues/ don’t work
    * concerts/year/month/day/postname shows all concerts, what I would like concerts/ to do
    * Same for venues/

    Thread Starter vsandvold

    (@vsandvold)

    Any help is appreciated, guys.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘conditional rewrite rules’ is closed to new replies.