I made the custom post type named "News" and I have a static page load for url/news
Currently, the archive page loads with this url: url/?post_type=news
How do I make it so that the archive page will load using this url: url/news/all-news
Note: I'm using elementor
I made the custom post type named "News" and I have a static page load for url.com/news
Currently, the archive page loads with this url: url.com/?post_type=news
How do I make it so that the archive page will load using this url: url.com/news/all-news
Note: I'm using elementor
The has_archive
parameter for registering the post type should work (untested):
register_post_type( 'news', array(
...
'has_archive' => 'news/all-news',
'rewrite' => array(
'slug' => 'news',
'with_front' => false,
),
) );
Remember to flush the permalinks by going to Settings > Permalinks and clicking Save button.