How to create a permalink structure for posts in a specific category

I am not sure if this is the best solution or not, but it works: function movie_review_permalink( $url, $post, $leavename ) { $category = get_the_category($post->ID); if ( !empty($category) && $category[0]->slug == “test” ) { //change ‘test’ to your category slug $date=date_create($post->post_date); $my_date = date_format($date,”dmY”); $url= trailingslashit( home_url(“https://wordpress.stackexchange.com/”. $category[0]->slug .”https://wordpress.stackexchange.com/”. $post->post_name .’-‘. $my_date .”https://wordpress.stackexchange.com/” ) ); … Read more

Create permalink structure for one taxonomy archive per custom post type

This is very easy to do by adding custom rewrite rules. This should get you started: add_action( ‘init’, ‘wpse_100386_rewrites’ ); function wpse_100386_rewrites() { add_rewrite_rule( ‘case-studies/room/([^/]+)/?’, ‘index.php?the_room=$matches[1]&post_type=the_case_study’, ‘top’ ); add_rewrite_rule( ‘videos/room/([^/]+)/?’, ‘index.php?the_room=$matches[1]&post_type=the_video’, ‘top’ ); } As always when changing rewrite rules, be sure to flush your rewrite rules by going to Settings -> Permalinks and click … Read more

How to remove “admin.php?page=” from wp-admin using .htaccess?

You can try this (sorry, not previously tested). See comments inline for explanation: RewriteEngine On ## if any string separated by | is matched, it will append to ?page= RewriteRule ^(members|add-members|delete)$ admin.php?page=%1 [L,E=CLEAN_CONTACT_URL:1,QSA] ## If querystring starts with page= and is followed by any string separated by | ## put that in the first group. … Read more

How to filter custom post type archive by meta value

Like Bainternet said in comments, you’ll need to mess with add_query_var as well as add_rewrite_rule. We usually do something similar to: global $wp; $wp->add_query_var( ‘some_var’ ); add_rewrite_rule( ‘some/path/([^/]+)/?$’, ‘index.php?some_var=$matches[1]’ ); See this WordPress Trac ticket, as well as documentation on add_query_var and add_rewrite_rule