Rewriting a custom-post-type permalink with taxonomy term?
Change all your %event% to %event_type%. I hope that works for you.
Change all your %event% to %event_type%. I hope that works for you.
I’m almost sure that author is built-in, so use something like author_more. You will need to add that var to query_vars first. Example: // add `author_more` to query vars add_filter( ‘init’, ‘add_author_more_query_var’ ); function add_author_more_query_var() { global $wp; $wp->add_query_var( ‘author_more’ ); } Then on your more-author-posts.php template call it like this: if ( get_query_var( ‘author_more’ … Read more
Check the slugs of the other pages – chances are /company/ is being used for one of those. You could also go to /company/ on your site and see if anything pulls up. As mentioned in a comment, make sure to check the trash as well. You may have deleted a page with that name, … Read more
Actually there is no communication happening between Apache and WordPress. The “magic” is happening in Apache mod_rewrite rules. For a standard WordPress installation, you have the following rules in .htaccess: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # … Read more
Use $_SERVER[‘REQUEST_URI’] instead of get_permalink() to grab the current URL. get_permalink will give you the full address of the current post, not the address of the URL visited. e.g. for example.com/test/page echo $_SERVER[‘REQUEST_URI’]; prints /test/page Note that this doesn’t include the hashtag, as that part never gets sent to the server, and it also doesn’t … Read more
You can add an endpoint to your URIs to handle special requests. Here is a basic example as plugin. To understand what’s going on read Christopher Davis‘s fantastic tutorial A (Mostly) Complete Guide to the WordPress Rewrite API. <?php # -*- coding: utf-8 -*- /** * Plugin Name: T5 Endpoint Example * Description: Adds a … Read more
This is what I use to rewrite custom post type URLs with the post ID. You need a rewrite rule to translate URL requests, as well as a filter on post_type_link to return the correct URLs for any calls to get_post_permalink(): add_filter(‘post_type_link’, ‘wpse33551_post_type_link’, 1, 3); function wpse33551_post_type_link( $link, $post = 0 ){ if ( $post->post_type … Read more
At blog site set Settings -> Permalinks -> Common Setting -> Default (Must select default only and don’t touch any thing, If you need to change category base, tag base set at Network Admin only) At Network Admin -> Sites -> (root site) Permalink Sturcture -> /%category%/%post_id% That it will remove /blog slug
Well, there is another way. And better, I guess. You should look at register_post_type parameters. You should probably set them like this: ‘public’ => false, // it’s not public, it shouldn’t have it’s own permalink, and so on ‘publicly_queryable’ => true, // you should be able to query it ‘show_ui’ => true, // you should … Read more
This should work: ‘rewrite’ => array( ‘slug’ => ‘about-us/our-people’), combined with: ‘has_archive’ => false, Make sure to visit the Permalinks settings page in your admin after you made the changes to flush the rewrite rules.