Yes you can use the rewrite parameter when creating your custom post type:
register_post_type( 'example_type',
array(
'labels' => array(
'name' => "Example-Type",
'singular_name' => "example-type"
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'the-url-you-want',
)
);
}
You will need to reset your permalinks for it to take effect as well.
EDIT:
function custom_post_link( $post_link, $id = 0 ){
$post = get_post($id);
if ( is_object( $post ) ){
$terms = wp_get_object_terms( $post->ID, 'category' );
if( $terms ){
return str_replace( '%category%' , $terms[0]->slug , $post_link );
}
}
return $post_link;
}
add_filter( 'post_type_link', 'custom_post_link', 1, 3 );
Related Posts:
- Mixing custom post type and taxonomy rewrite structures?
- How to rewrite URI of custom post type?
- How to remove slug from hierarchical custom types in 3.5.2
- Custom post types – Use post_id in permalink structure
- Custom Post Type and Taxonomy URL rewrite
- Custom post type permalink: only use %post_id% and remove %postname%
- Is it possible to change the URL of custom post types to hide the post type slug?
- Archive page with multiple taxonomies rewrite
- rewrite get parameter with custom post type
- Taxonomy page returns 404 page not found
- How to have a custom URL structure for a custom post type?
- Display CPT taxonomies as an archive page
- Including two taxonomies in a permalink structure
- WP Rewrite Rules – Custom post type & taxonomy
- URL Design for Sub-Posts?
- Remove base slug in CPT & CT, use CT in permalink
- How do I list terms of a custom taxonomy at i.e. domain.com/brands/
- Permalink Structure problem with cpt and custom taxonomy
- Custom Taxonomy 404
- Custom Post Type rewrite redirects to homepage
- Custom Post Type slug same as page name causing a conflict
- single-{post_type}.php is not loaded despite flushing rules
- Adding paged query to custom URL rewrite
- Custom Post Type rewrite rules not working, how to alter the rewrite order?
- Custom Permalink for Taxonimie and Custom Post Type
- Rewrite Custom Post Type URL slug
- Rewrite numeric ID parameter for hierarchical custom post type
- Customising rewrite rules for CPT single post URL to work as paged URL
- Remove custom post type slug not working for child pages
- Custom WP TItle from custom template with dynamic URL structure
- Rewrite rules for custom post type slug
- In WordPress how do you create a custom post type with the author’s name in the slug?
- Change URL of posts and also Custom Post Type
- Custom Post Type rewrite
- How can I display an archive of only one category of my custom post type?
- Permalink Structure CPT With Custom Taxonomy Fails
- Conditionally custom post type url rewrite
- Making a custom help center page
- Remove url rewrites for registered taxonomies
- Get Taxonomy Term Title by it’s URL
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- WordPress custom post type permalink rewrite shows page not found
- Using taxonomy term in CPT permalink – Pages 404’s
- Customize Custom Post Type URL
- Programmatically rewriting slug through functions.php but returns 404
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Why isn’t my custom post type archive URL translating?
- Custom Post Type and Category Base Rewrite Issue
- Rewrite URL of Custom Post Type for Jobs
- Post Type rewrite rule to point to custom Page/template
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Taxonomy in URL
- Custom permalink with child taxonomy terms
- Custom post type archive with page as parent url
- Pagination custom post type not working with rewrite slug
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- After creating Custom post type by user delete old one
- Set parent for custom post type archive rewrite url
- How do I know if a rewritten rule was applied?
- URL Rewrite – Page Archive
- How Can I Remove Custom Post Type Slug From URL
- WordPress custom permalink and archive link for custom post type
- get_post_permalink() and custom permalink rewriting
- Custom Post Types and Removing Slugs – should we do it?
- Pagination for custom post types – url rewriting
- Taxonomy rewrite pagination 404
- Custom rewrite rule takes place AFTER the generic category rule
- Adding /blog in front of single posts (only)
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- multiple URLS for the same page
- How to properly set the rewrite rules for this case?
- Define multiple prefixes for custom post type
- How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug
- Custom post type structure + permalink structure
- Rewrite URL of Specific Post of Custom Type
- Using get_post_type with a custom URL format?
- Show index and not the archive for “Dog Custom Post” with default slug
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- Remove custom post type slug but keep related category taxonomy permalink
- page not found for example.com/custom-post-name
- Force WordPress to only match URL in category
- Paging not working for hierarchical custom post type
- Custom post type with parent page? Possible?
- Custom Post Type URL Rewriting
- Archive page for a custom post type using WPML
- Why won’t this rewrite rule work?
- Cannot modify a registered custom post type rewrite slug
- Customize category URL
- Custom Post Type Rewrite Rule
- rewrite rules add a folder in the path
- Generating custom URL before post is published
- Custom Taxonomy in Permalink from post type
- Custom post type permalink structure
- How can i change url structure of cpt like this?
- Rewrite nested urls for custom post type
- Custom post type Premalinks main page and details page
- Custom post type with custom taxonomies structure url not working archive of CPT
- Rewrite rule taxonomy url with different values in one function
- Remove date rewrite rule for custom post type archive page