Custom taxonomy and post type rewrite rules

I hope i understand you 🙂 I think the easiet way (in my humble opion) the best way is to use taxomonies like so: function portfolio_taxomony() { register_taxonomy( ‘portfolio’, ‘post’, array( ‘hierarchical’ => true, ‘label’ => ‘Web Design’, ‘query_var’ => true, ‘rewrite’ => true ) ); } add_action( ‘init’, ‘portfolio_taxomony’, 0 ); (Web Design if … Read more

Rewrite rules for custom post type

You need to look at add_rewrite_tag() and add_rewrite_rule() Also read this and this topics. They are very close to you issue. After you setup rewrite rule don’t forget to flush rules add_action( ‘wp_loaded’,’my_flush_rules’ ); // flush_rules() if our rules are not yet included function my_flush_rules(){ $rules = get_option( ‘rewrite_rules’ ); $pattern = ‘news/([^/]+)?’; // the … Read more

How can I allow trailing slashes on some URLs without a redirect, but not on others?

Use flush_rewrite_rules(): add_action( ‘init’, ‘my_rewrite_func’ ); function my_rewrite_func() { add_rewrite_rule( ‘post4/$’, ‘index.php?p=12’, ‘top’ ); flush_rewrite_rules(); } and / or whichever rewrite rules you use, you could always use /? for optional trailing slashes or force the trailing slash if you would prefer for it to always be there.

Need Help with Custom ModRewrite

This can be accomplished with WordPress’s internal rewrite system by using add_rewrite_rule and adding a query var. function wpse47506_rewrites_init(){ add_rewrite_rule( ‘about/case-studies/([^/]+)/?$’, ‘index.php?pagename=about/case-studies&clientname=$matches[1]’, ‘top’ ); } add_action( ‘init’, ‘wpse47506_rewrites_init’ ); function wpse47506_query_vars( $query_vars ){ $query_vars[] = ‘clientname’; return $query_vars; } add_filter( ‘query_vars’, ‘wpse47506_query_vars’ ); This would go in your functions.php file, then visit the permalinks settings … Read more