Post Type Rewrite Custom
Post Type Rewrite Custom
Post Type Rewrite Custom
How can I process all requests for a given directory in a URL with my plugin?
You can use the same answer as the question you referred to (I have answered it). Here’s how you would change to pass the arguments: <?php add_action(‘init’, ‘add_my_rule’); function add_my_rule() { global $wp; $wp->add_query_var(‘args’); add_rewrite_rule(‘test\/finaldestination\/(.*)’,’index.php?pagename=about&args=$matches[1]’,’top’); } ?> Assuming ‘finaldestination’ stays the same always, and the pagename (slug) is ‘about’ (you can change both). Apply your … Read more
rewrite rule for home/index page
You don’t need a custom rewrite rule to handle this, just set your taxonomy rewrite slug like: ‘rewrite’ => array( ‘slug’ => ‘projects/category/%project_cat%’ )
add_rewrite_rule not working
How to make a custom route with any-string-part/number-part pointing to an existing page?
Rewrite URL based on form input
wow, after more banging of my head against the wall, it took this: add_rewrite_rule(‘work/all/([^/]*)/([^/]*)/?’, ‘index.php?post_type=project&name=$matches[2]&mode=all’, ‘top’); Two things actually, I had to include a post_type=project part as well as change pagename to name. If I remove either one, I get my previous results. I am not sure why this set of values works when other … Read more
You can try switching to basic permalink structure (the one with post id format) and then again choose custom permalink. Or you can use following plugin to write desired URL for each page Custom Permalink Plugin