I want to get this link structure mysite.com/sa/post-slug/post_id/ on my custom post-type.
This is the post_type:
// ex_article Post type
add_action( 'init', 'ex_article_init' );
function ex_article_init() {
$args = array(
'labels' => array(
'name' => _x( 'Article', 'Post type general name', 'textdomain' ),
'menu_name' => _x( 'Ex Article', 'Admin Menu text', 'textdomain' )
),
'public' => true,
'show_ui' => true,
'hierarchical' => false,
'rewrite' => array('slug' => 'sa', 'with_front'=>false ),
---
---
---
);
register_post_type( 'ex_article', $args );
}
On permalink setting, I use Post Name : mysite.com/sample-post/
. Using a custom structure is not an option for me, I need to avoid it, and also it does nothing to custom post type.