Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
Try something like this: function custom_rewrite( $wp_rewrite ) { $feed_rules = array( ‘(.+)/blog/(.+)’ => ‘index.php?custom_tax=’.$wp_rewrite->preg_index(1).’&post_name=” . $wp_rewrite->preg_index(2) ); // ( array merge must be done this way, to ensure new rule comes first ) $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules; } // refresh/flush permalinks in the dashboard if this is changed in any way add_filter( “generate_rewrite_rules’, … Read more
My plugin Custom Post Permalinks does this sort of thing for you: http://wordpress.org/extend/plugins/custom-post-permalinks If you’d rather use your own solution, I’ll need a bit more information, such as the registration code for the forums taxonomy. Just guessing, I’m thinking the regex for a forum looks identical to the regex for a topic to the rewrite … Read more
This is probably not possible or it would require some really scary and fragile hacks. Use a custom taxonomy for the news or a custom post type instead. Setting a different permalink structure for these is much easier. You should find enough examples on our site.
How can I change permalinks to use a different domain and path from where the blog is hosted?
In the link you attached, you have everything you need. You should: add query variable (e.g operators_actv), add rewrite rule that sets this variable (operators_actv), use the template_include action hook to load custom template if query variable operators_actv is set. Code: add_filter( ‘query_vars’, ‘se332319_custom_query_vars’ ); add_filter( ‘template_include’, ‘se332319_custom_template’, 50 ); add_action( ‘generate_rewrite_rules’, ‘se332319_resources_cpt_generating_rule’ ); function … Read more
The main problem with the regex based way wordpress does URL parsing/routing/”rewriting” is that regexp lacks any context. All the URLs of countries you will have need to be in the specific context of a continent. If there are two countries with the same name best country, one in continent big and the other in … Read more
Please try this. First add the rewrite rule you need with this function add_action( ‘init’, ‘rewrite_site_tools_page’ ); function rewrite_site_tools_page() { add_rewrite_rule( ‘^site-tools-([^/]+)$’, ‘index.php?pagename=site-tools&tool=$matches[1]’, ‘top’); } Assuming that page name is site-tools. Now add the tool as query var add_filter(‘query_vars’, ‘wpd_query_vars’); function wpd_query_vars( $query_vars ){ $query_vars[] = ‘tool’; return $query_vars; } Save permalinks. Now if you … Read more
I’ll just copy/paste my answer to that question, here: There are many ways to accomplish this, though some are more advanced than others: Mark the blog post as sticky, and then set Posts per Page to 1 (Dashboard -> Settings -> Reading) Create a custom front-page.php template, and query the post in question, either via … Read more
You could use my plugin: http://wordpress.org/extend/plugins/custom-post-permalinks/ That will only work if it’s a non-hierarchical post type. If it’s hierarchical, you’re going to have to register the permastruct yourself. This is a huge ordeal which I don’t have the time to write out at the moment. You can look at the code in my plugin above … Read more