Rewriting a page with a custom parameter

To fix this issue, we had to add the “query variables” into the functions.php of our theme to add them to the public variables. function add_query_vars_filter($vars){ $vars[] = “subject”; $vars[] = “param”; return $vars; } add_filter(‘query_vars’, ‘add_query_vars_filter’); This allowed us to retrieve the variables’ value this way. $subject = get_query_var(‘subject’, false);

Custom Post type and permalink settings

You can use the rewrite parameter to disable the front portion of the URLs (/academy/ in your case) for custom post types. function create_posttypes() { $labels1 = array( ‘name’ => __( ‘Definitions’ ), ‘singular_name’ => __( ‘Definition’ ), ‘all_items’ => __( ‘All Definitions’ ), ‘view_item’ => __( ‘View Definition’ ), ‘add_new_item’ => __( ‘Add New … Read more

Add archive slug to default post post type

Using the permalink settings to configure your post permalinks, then modifying the author permalinks seems like the way to go. I set up the permalink rules like this: /post/%postname%/ Then used this code to modify the author permalinks (source): // change base of author pages- need to save permalinks to take effect function wpse82004_change_author_permalink(){ global … Read more

Remove custom taxonomy base from URL

Depending on how you are registering your custom post types, you can simply set the rewrite rules for it like so: $args = array( ‘description’ => ‘Photograph Post Type’, ‘label’ => __(‘Photographs’), ‘public’ => true, ‘rewrite’ => array( ‘slug’ => ‘photograph’), ); register_post_type( ‘photograph’ , $args ); If (for some bizarre reason) you don’t have … Read more

How to have custom post type /example/ and then posts /example/posts.html

This is exactly how wordpress works. For each Custom Post type Create an archive-custom_post_type_name.php and a single-custom_post_type_name.php WordPress automatically loads that file when someone goes to the url. so if your custom posts types were koolio and notsokool then you would need these 4 files in your theme child (you’re using a child theme, right?!) … Read more