You have to choose which page you want to get your website.com/products URL.
If it’s the page you’re creating inside the panel, you’ll need to change the post_type permalink. If you are registering this post_type programmatically you should add the rewrite argument, as per Codex:
rewrite
(Boolean or array) (optional) Triggers the Handling of rewrites for this post type. To Prevent rewrites, set to false.
Default: true and use $post_type as Slug
$args array
'Slug' => string Customize the permalink Structure Slug. Defaults to the $post_type value. Should be translatable.
'with_front' => bool Should the permalink Structure be prepended with the front base. (example: if your permalink Structure is /blog/,
then your links will be: false->/news/, true->/blog/news/). Defaults
to true
'feeds' => bool Should a feed permalink Structure be built for this post type. Defaults to has_archive value.
'pages' => bool Should the permalink Structure provide for pagination. Defaults to true
'ep_mask' => const As of 3.4 Assign an endpoint Mask for this post type. For more info see Rewrite API/add_rewrite_endpoint, Trac Ticket
19275, and this Make Wordpress Plugins Summary of endpoints.
If not specified and permalink_epmask is set, Inherits from permalink_epmask
If not specified and permalink_epmask is not set, defaults to EP_PERMALINK
I also recommend using a different file for this page, instead of Archive-produtos.php. The best is to use a page-products.php template and leave Archive-products.php for a simple post type products file. So you don’t run the risk of the page being called by the post type url and the contents of the first loop not being found.
If you want the custom post type products page to have this url, then just change the title of the page you are creating inside the Panel and remember to use a template for this page. About templates
Add the code to the question.
– Guilherme Nascimento
I didn’t understand your question very well, you have an already created page called Products or a post_type called Products?
– Pedro Henrique
Both. Actually post_type calls products. I have an Archive-products.php and I can loop on it normally. However, before the loop need a dynamic content, which would have to be within pages in the wordpress menu. If I create a products page, to wordpress get the global $post automatically, the url will conflict, the page with the post_type. I have already created a page with a different url than post_type and I loop taking this page inside the Archive-products. That way it works, but I don’t even know if it’s the best way to do it. :)
– Guilherme