_x('Ourl Projects', 'post type general name'), 'singular_name' => _x('Project', 'post type singular name'), 'add_new' => _x('Add New', 'project'), 'add_new_item' => __('Add New site'), 'edit_item' => __('Edit Project'), 'new_item' => __('New Project'), 'view_item' => __('View Client'), 'search_items' => __('Search Projects'), 'not_found' => __('No projects found'), 'not_found_in_trash' => __('No projects found in Trash'), 'parent_item_colon' => '' ); $project_args = array( 'labels' => $project_labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, '_builtin' => false, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => null, 'taxonomies' => array('features'), 'rewrite' => array("slug" => "our-projects"), // Permalinks format 'supports' => array('title','editor','custom-fields','revisions','thumbnail') ); register_post_type('project',$project_args); global $wp_rewrite; $wp_rewrite->flush_rules(); } // Adding a new rule function wp_insertMyRewriteRules($rules){ $newrules = array(); foreach($this->bases as $base){ $newrules['^'.$base.'/page/?([0-9]{1,})/?$'] = 'index.php?post_type='.$base.'&paged=$matches[1]'; $newrules['^'.$base.'/?$'] = 'index.php?post_type='.$base; } return $newrules + $rules; } function redirect_canonical($redirect,$request){ foreach($this->bases as $base) if(strpos($request,get_option('siteurl').'/'.$base) !== false) return false; return $redirect; } }