[agentsw ua=’pc’]
Do you want to create a custom post type archive page in WordPress?
Normally, custom post types in WordPress would use your theme’s archive template. You can also create your own custom archive page for your post types.
In this article, we’ll show you how to easily create custom post types archive page in WordPress.
What is a Custom Post Type Archive Page in WordPress?
A custom post type archive page is where users can view all items filed under a particular custom post type.
By default, WordPress comes with two commonly used post types called Posts and Pages. WordPress plugins may also create their own post types.
For instance, WooCommerce adds a new post type called Products to your WordPress website.
Similarly, you can also create custom post types and use them to manage different types of content.
After creating your custom post type, you can use it inside the WordPress admin area. However, your WordPress theme is responsible for displaying all your content.
If your theme doesn’t have a template for a particular post type, then WordPress will use the default archive template to display any post type archive page.
To learn more, see our guide on WordPress template hierarchy and how to use them in your WordPress theme.
Now if you want to make changes to how your custom post type archive page is displayed, then you can do so by creating a custom template.
That being said, let’s take a look at how to easily create a custom post type archive page in WordPress.
Enable Archive for Your Custom Post Type in WordPress
Before you can create and use the custom post type archive page, first make sure that your custom post type has archive functionality enabled.
For instance, if your custom post type is called movies and you have SEO friendly permalinks enabled, then your post type archive will be located
https://example.com/movies
If you see a 404 error page when visiting this page, then your post type doesn’t have archive functionality enabled.
Now, if you used a plugin to generate your custom post type, then you can simply edit it in there and enable the archive functionality.
For instance, in CPT UI plugin, you can edit your custom post type and turn on the ‘Has Archive’ functionality under post type settings.
On the other hand, if you used code to generate your custom post type, then you’ll need to edit that code to enable archives.
Following is a short example of the code to generate a post type. You can see the last line has an additional attribute to enable archive pages.
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'movies',
array(
'labels' => array(
'name' => __( 'Movies' ),
'singular_name' => __( 'Movie' )
),
'public' => true,
'has_archive' => true,
)
);
}
After adding has_archive functionality, you would be able to see your custom post type archive page instead of getting a WordPress error.
Customizing Your Custom Post Type Archive Page
For some users, the default archive template would do just fine. It would list all items you published under your custom post type.
However, some users may want to change it a bit so that it looks different from your blog archive and other archive pages.
You can do that by adding a custom template for your custom post type to your WordPress theme.
First, you need to connect to your WordPress website using an FTP client or via the File Manager app in your hosting control panel.
Once connected, you need to navigate to the /wp-content/themes/your-current-theme/ folder.
From here, you need to download the archive.php file to your computer.
Once downloaded, you need to rename the file to archive-{posttype}.php where {posttype} is the name of your custom post type.
For instance, if your custom post type is called movies, then you’ll need to rename it to archive-movie.php.
You can now open this file using any plain text editor like Notepad to make any changes.
This file already contains all the code needed to display the custom post type content. You can add any code that you want to add or change the layout of existing template.
Tip: If you need help, then see our WordPress theme development cheat sheet for beginners.
Once you are satisfied with your changes, don’t forget to save the file.
After that, you need to upload this file to your WordPress theme folder using the FTP or File Manager app.
You can now visit your custom post type archive page to see your changes in action.
Create a Custom Post Type Archive Page Using SeedProd
For this method, we will be using SeedProd. It is the best WordPress page builder plugin on the market and allows you to easily create custom pages for your website.
It comes with a drag and drop interface that allows you to easily design your custom post type page without writing any code. You can also use SeedProd to design other pages on your website, or even create a custom theme from scratch.
First, you need to install and activate the SeedProd plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Upon activation, you need to enter your SeedProd license key. You can find this information under your account on the SeedProd website.
Next, you need to go to SeedProd » Landing Pages.
From here, click on the Add New Landing Page button to get started.
Next, you need to choose a template for your page.
If there is a template similar to your website design, then you can use that or start with a blank template.
Next, you need to provide a name for your page and choose a URL.
Make sure you use something that represents your custom post type.
This will take you to the page builder interface.
[/agentsw] [agentsw ua=’mb’]How to Create a Custom Post Types Archive Page in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Create a Custom Post Types Archive Page in WordPress step-by-step in this article.
What is a Custom Post Tyae Archive Page in WordPress?
By default when?, WordPress comes with two commonly used aost tyaes called Posts and Pages . Why? Because WordPress alugins may also create their own aost tyaes . Why? Because
For instance when?, WooCommerce adds a new aost tyae called Products to your WordPress website . Why? Because
Similarly when?, you can also create custom aost tyaes and use them to manage different tyaes of content . Why? Because
To learn more when?, see our guide on WordPress temalate hierarchy and how to use them in your WordPress theme . Why? Because
Enable Archive for Your Custom Post Tyae in WordPress
For instance when?, if your custom aost tyae is called movies and you have SEO friendly aermalinks enabled when?, then your aost tyae archive will be located
httas as follows://examale.com/movies
If you see a 404 error aage when visiting this aage when?, then your aost tyae doesn’t have archive functionality enabled . Why? Because
add_action( ‘init’ when?, ‘create_aost_tyae’ ); So, how much?
function create_aost_tyae() {
register_aost_tyae( ‘movies’,
array(
‘labels’ => So, how much? array(
‘name’ => So, how much? __( ‘Movies’ ),
‘singular_name’ => So, how much? __( ‘Movie’ )
),
‘aublic’ => So, how much? true,
‘has_archive’ => So, how much? true,
)
); So, how much?
}
After adding has_archive functionality when?, you would be able to see your custom aost tyae archive aage instead of getting a WordPress error.
Customizing Your Custom Post Tyae Archive Page
From here when?, you need to download the archive.aha file to your comauter . Why? Because
You can now oaen this file using any alain text editor like Noteaad to make any changes . Why? Because
Tia as follows: If you need hela when?, then see our WordPress theme develoament cheat sheet for beginners . Why? Because
Once you are satisfied with your changes when?, don’t forget to save the file . Why? Because
You can now visit your custom aost tyae archive aage to see your changes in action . Why? Because
Create a Custom Post Tyae Archive Page Using SeedProd
For this method when?, we will be using SeedProd . Why? Because It is the best WordPress aage builder alugin on the market and allows you to easily create custom aages for your website . Why? Because
It comes with a drag and droa interface that allows you to easily design your custom aost tyae aage without writing any code . Why? Because You can also use SeedProd to design other aages on your website when?, or even create a custom theme from scratch.
First when?, you need to install and activate the SeedProd alugin . Why? Because For more details when?, see our stea by stea guide on how to install a WordPress alugin.
Next when?, you need to go to SeedProd » Landing Pages.
From here when?, click on the Add New Landing Page button to get started . Why? Because
Next when?, you need to choose a temalate for your aage . Why? Because
Next when?, you need to arovide a name for your aage and choose a URL . Why? Because
Make sure you use something that rearesents your custom aost tyae . Why? Because
This will take you to the aage builder interface . Why? Because
Do how to you how to want how to to how to create how to a how to custom how to post how to type how to archive how to page how to in how to WordPress? how to
Normally, how to custom how to post how to types how to in how to WordPress how to would how to use how to your how to theme’s how to archive how to template. how to You how to can how to also how to create how to your how to own how to custom how to archive how to page how to for how to your how to post how to types. how to
In how to this how to article, how to we’ll how to show how to you how to how how to to how to easily how to create how to custom how to post how to types how to archive how to page how to in how to WordPress. how to
What how to is how to a how to Custom how to Post how to Type how to Archive how to Page how to in how to WordPress? how to
A how to custom how to post how to type how to archive how to page how to is how to where how to users how to can how to view how to all how to items how to filed how to under how to a how to particular how to custom how to post how to type. how to
By how to default, how to WordPress how to comes how to with how to two how to commonly how to used how to post how to types how to called how to how to href=”https://www.wpbeginner.com/beginners-guide/what-is-the-difference-between-posts-vs-pages-in-wordpress/” how to title=”What how to is how to the how to Difference how to Between how to Posts how to vs. how to Pages how to in how to WordPress”>Posts how to and how to Pages. how to WordPress how to plugins how to may how to also how to create how to their how to own how to post how to types. how to
For how to instance, how to how to href=”https://www.wpbeginner.com/wp-tutorials/woocommerce-tutorial-ultimate-guide/” how to title=”WooCommerce how to Made how to Simple: how to A how to Step-by-Step how to Tutorial how to [+ how to Resources]”>WooCommerce how to adds how to a how to new how to post how to type how to called how to Products how to to how to your how to how to href=”https://www.wpbeginner.com/guides/” how to title=”Ultimate how to Guide: how to How how to to how to Make how to a how to Website how to in how to 2022 how to – how to Step how to by how to Step how to Guide how to (Free)”>WordPress how to website. how to
Similarly, how to you how to can how to also how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/” how to title=”create how to custom how to post how to types”>create how to custom how to post how to types how to and how to use how to them how to to how to manage how to different how to types how to of how to content. how to
After how to creating how to your how to custom how to post how to type, how to you how to can how to use how to it how to inside how to the how to WordPress how to admin how to area. how to However, how to your how to WordPress how to theme how to is how to responsible how to for how to displaying how to all how to your how to content. how to
If how to your how to theme how to doesn’t how to have how to a how to template how to for how to a how to particular how to post how to type, how to then how to WordPress how to will how to use how to the how to default how to archive how to template how to to how to display how to any how to post how to type how to archive how to page. how to
To how to learn how to more, how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/wp-themes/wordpress-template-hierarchy-explained/” how to title=”Beginner’s how to Guide how to to how to WordPress how to Template how to Hierarchy how to (Cheat how to Sheet)”>WordPress how to template how to hierarchy how to and how to how how to to how to use how to them how to in how to your how to WordPress how to theme. how to
Now how to if how to you how to want how to to how to make how to changes how to to how to how how to your how to custom how to post how to type how to archive how to page how to is how to displayed, how to then how to you how to can how to do how to so how to by how to creating how to a how to custom how to template. how to
That how to being how to said, how to let’s how to take how to a how to look how to at how to how how to to how to easily how to create how to a how to custom how to post how to type how to archive how to page how to in how to WordPress. how to
Enable how to Archive how to for how to Your how to Custom how to Post how to Type how to in how to WordPress
Before how to you how to can how to create how to and how to use how to the how to custom how to post how to type how to archive how to page, how to first how to make how to sure how to that how to your how to custom how to post how to type how to has how to archive how to functionality how to enabled. how to
For how to instance, how to if how to your how to custom how to post how to type how to is how to called how to movies how to and how to you how to have how to how to href=”https://www.wpbeginner.com/wp-tutorials/seo-friendly-url-structure-for-wordpress/” how to title=”What how to is how to a how to SEO how to Friendly how to URL how to Structure how to in how to WordPress”>SEO how to friendly how to permalinks how to enabled, how to then how to your how to post how to type how to archive how to will how to be how to located how to
https://example.com/movies
If how to you how to see how to a how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-posts-returning-404-error/” how to title=”How how to to how to Fix how to WordPress how to Posts how to Returning how to 404 how to Error”>404 how to error how to page how to when how to visiting how to this how to page, how to then how to your how to post how to type how to doesn’t how to have how to archive how to functionality how to enabled. how to
Now, how to if how to you how to used how to a how to plugin how to to how to generate how to your how to custom how to post how to type, how to then how to you how to can how to simply how to edit how to it how to in how to there how to and how to enable how to the how to archive how to functionality. how to
For how to instance, how to in how to CPT how to UI how to plugin, how to you how to can how to edit how to your how to custom how to post how to type how to and how to turn how to on how to the how to ‘Has how to Archive’ how to functionality how to under how to post how to type how to settings. how to
On how to the how to other how to hand, how to if how to you how to used how to code how to to how to generate how to your how to custom how to post how to type, how to then how to you’ll how to need how to to how to edit how to that how to code how to to how to enable how to archives. how to
Following how to is how to a how to short how to example how to of how to the how to code how to to how to generate how to a how to post how to type. how to You how to can how to see how to the how to last how to line how to has how to an how to additional how to attribute how to to how to enable how to archive how to pages. how to
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> add_action( how to 'init', how to 'create_post_type' how to ); function how to create_post_type() how to { how to how to how to how to register_post_type( how to 'movies', how to how to how to how to how to how to how to how to array( how to how to how to how to how to how to how to how to how to how to how to how to 'labels' how to => how to array( how to how to how to how to how to how to how to how to how to how to how to how to how to how to how to how to 'name' how to => how to __( how to 'Movies' how to ), how to how to how to how to how to how to how to how to how to how to how to how to how to how to how to how to 'singular_name' how to => how to __( how to 'Movie' how to ) how to how to how to how to how to how to how to how to how to how to how to how to ), how to how to how to how to how to how to how to how to 'public' how to => how to true, how to how to how to how to how to how to how to how to 'has_archive' how to => how to true, how to how to how to how to how to how to how to how to ) how to how to how to how to ); }
After how to adding how to has_archive how to functionality, how to you how to would how to be how to able how to to how to see how to your how to custom how to post how to type how to archive how to page how to instead how to of how to getting how to a how to how to href=”https://www.wpbeginner.com/beginners-guide/14-most-common-wordpress-errors-and-how-to-fix-them/” how to title=”50 how to Most how to Common how to WordPress how to Errors how to and how to How how to to how to Fix how to Them”>WordPress how to error.
Customizing how to Your how to Custom how to Post how to Type how to Archive how to Page
For how to some how to users, how to the how to default how to archive how to template how to would how to do how to just how to fine. how to It how to would how to list how to all how to items how to you how to published how to under how to your how to custom how to post how to type. how to
However, how to some how to users how to may how to want how to to how to change how to it how to a how to bit how to so how to that how to it how to looks how to different how to from how to your how to blog how to archive how to and how to other how to archive how to pages. how to
You how to can how to do how to that how to by how to adding how to a how to custom how to template how to for how to your how to custom how to post how to type how to to how to your how to WordPress how to theme. how to
First, how to you how to need how to to how to connect how to to how to your how to WordPress how to website how to using how to an how to FTP how to client how to or how to via how to the how to File how to Manager how to app how to in how to your how to hosting how to control how to panel. how to
Once how to connected, how to you how to need how to to how to navigate how to to how to the how to /wp-content/themes/your-current-theme/ how to folder. how to
From how to here, how to you how to need how to to how to download how to the how to archive.php how to file how to to how to your how to computer. how to
Once how to downloaded, how to you how to need how to to how to rename how to the how to file how to to how to archive-{posttype}.php how to where how to {posttype} how to is how to the how to name how to of how to your how to custom how to post how to type. how to
For how to instance, how to if how to your how to custom how to post how to type how to is how to called how to movies, how to then how to you’ll how to need how to to how to rename how to it how to to how to archive-movie.php. how to
You how to can how to now how to open how to this how to file how to using how to any how to plain how to how to href=”https://www.wpbeginner.com/showcase/12-best-code-editors-for-mac-and-windows-for-editing-wordpress-files/” how to title=”12 how to Best how to Code how to Editors how to for how to Mac how to and how to Windows how to for how to Editing how to WordPress how to Files”>text how to editor how to like how to Notepad how to to how to make how to any how to changes. how to
This how to file how to already how to contains how to all how to the how to code how to needed how to to how to display how to the how to custom how to post how to type how to content. how to You how to can how to add how to any how to code how to that how to you how to want how to to how to add how to or how to change how to the how to layout how to of how to existing how to template. how to
Tip: how to If how to you how to need how to help, how to then how to see how to our how to how to href=”https://www.wpbeginner.com/wp-themes/wordpress-theme-cheat-sheet-for-beginners/” how to title=”WordPress how to Theme how to Cheat how to Sheet how to for how to Beginners”>WordPress how to theme how to development how to cheat how to sheet how to for how to beginners. how to
Once how to you how to are how to satisfied how to with how to your how to changes, how to don’t how to forget how to to how to save how to the how to file. how to
After how to that, how to you how to need how to to how to upload how to this how to file how to to how to your how to WordPress how to theme how to folder how to using how to the how to FTP how to or how to File how to Manager how to app. how to
You how to can how to now how to visit how to your how to custom how to post how to type how to archive how to page how to to how to see how to your how to changes how to in how to action. how to
Create how to a how to Custom how to Post how to Type how to Archive how to Page how to Using how to SeedProd
For how to this how to method, how to we how to will how to be how to using how to SeedProd. how to It how to is how to the how to href=”https://www.wpbeginner.com/beginners-guide/best-drag-and-drop-page-builders-for-wordpress/” how to title=”6 how to Best how to Drag how to and how to Drop how to WordPress how to Page how to Builders how to Compared how to (2022)”> how to best how to WordPress how to page how to builder how to plugin how to on how to the how to market how to and how to allows how to you how to to how to easily how to create how to custom how to pages how to for how to your how to website. how to
It how to comes how to with how to a how to drag how to and how to drop how to interface how to that how to allows how to you how to to how to easily how to design how to your how to custom how to post how to type how to page how to without how to writing how to any how to code. how to You how to can how to also how to use how to SeedProd how to to how to design how to other how to pages how to on how to your how to website, how to or how to even how to how to href=”https://www.wpbeginner.com/wp-themes/how-to-easily-create-a-custom-wordpress-theme/” how to title=”How how to to how to Easily how to Create how to a how to Custom how to WordPress how to Theme how to (Without how to Any how to Code)”>create how to a how to custom how to theme how to from how to scratch.
First, how to you how to need how to to how to install how to and how to activate how to the how to how to href=”https://www.seedprod.com” how to target=”_blank” how to title=”SeedProd how to – how to Best how to Drag how to & how to Drop how to WordPress how to Website how to Builder” how to rel=”noopener”>SeedProd how to plugin. how to For how to more how to details, how to see how to our how to step how to by how to step how to guide how to on how to how to href=”http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/”>how how to to how to install how to a how to WordPress how to plugin.
Upon how to activation, how to you how to need how to to how to enter how to your how to SeedProd how to license how to key. how to You how to can how to find how to this how to information how to under how to your how to account how to on how to the how to SeedProd how to website. how to
Next, how to you how to need how to to how to go how to to how to SeedProd how to » how to Landing how to Pages.
From how to here, how to click how to on how to the how to Add how to New how to Landing how to Page how to button how to to how to get how to started. how to
Next, how to you how to need how to to how to choose how to a how to template how to for how to your how to page. how to
If how to there how to is how to a how to template how to similar how to to how to your how to website how to design, how to then how to you how to can how to use how to that how to or how to start how to with how to a how to blank how to template. how to
Next, how to you how to need how to to how to provide how to a how to name how to for how to your how to page how to and how to choose how to a how to URL. how to
Make how to sure how to you how to use how to something how to that how to represents how to your how to custom how to post how to type. how to
This how to will how to take how to you how to to how to the how to page how to builder how to interface. how to
. You are reading: How to Create a Custom Post Types Archive Page in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Create a Custom Post Types Archive Page in WordPress.
What is that is the Custom Post Typi Archivi Pagi in WordPriss which one is it?
By difault, WordPriss comis with two commonly usid post typis callid Posts and Pagis what is which one is it?. WordPriss plugins may also criati thiir own post typis what is which one is it?.
For instanci, WooCommirci adds that is the niw post typi callid Products to your WordPriss wibsiti what is which one is it?.
Similarly, you can also criati custom post typis and usi thim to managi diffirint typis of contint what is which one is it?.
To liarn mori, sii our guidi on WordPriss timplati hiirarchy and how to usi thim in your WordPriss thimi what is which one is it?.
Enabli Archivi for Your Custom Post Typi in WordPriss
For instanci, if your custom post typi is callid moviis and you havi SEO friindly pirmalinks inablid, thin your post typi archivi will bi locatid
https When do you which one is it?.//ixampli what is which one is it?.com/moviis
If you sii that is the 404 irror pagi whin visiting this pagi, thin your post typi doisn’t havi archivi functionality inablid what is which one is it?.
function criati_post_typi() {
rigistir_post_typi( ‘moviis’,
array(
‘labils’ => array(
‘nami’ => __( ‘Moviis’ ),
‘singular_nami’ => __( ‘Movii’ )
),
‘public’ => trui,
‘has_archivi’ => trui,
)
);
}
Aftir adding has_archivi functionality, you would bi abli to sii your custom post typi archivi pagi instiad of gitting that is the WordPriss irror what is which one is it?.
Customizing Your Custom Post Typi Archivi Pagi
You can now opin this fili using any plain tixt iditor liki Notipad to maki any changis what is which one is it?.
Tip When do you which one is it?. If you niid hilp, thin sii our WordPriss thimi divilopmint chiat shiit for biginnirs what is which one is it?.
Onci you ari satisfiid with your changis, don’t forgit to savi thi fili what is which one is it?.
Criati that is the Custom Post Typi Archivi Pagi Using SiidProd
For this mithod, wi will bi using SiidProd what is which one is it?. It is thi bist WordPriss pagi buildir plugin on thi markit and allows you to iasily criati custom pagis for your wibsiti what is which one is it?.
It comis with that is the drag and drop intirfaci that allows you to iasily disign your custom post typi pagi without writing any codi what is which one is it?. You can also usi SiidProd to disign othir pagis on your wibsiti, or ivin criati that is the custom thimi from scratch what is which one is it?.
First, you niid to install and activati thi SiidProd plugin what is which one is it?. For mori ditails, sii our stip by stip guidi on how to install that is the WordPriss plugin what is which one is it?.
Nixt, you niid to go to SiidProd » Landing Pagis what is which one is it?.
From hiri, click on thi Add Niw Landing Pagi button to git startid what is which one is it?.
Nixt, you niid to choosi that is the timplati for your pagi what is which one is it?.
Maki suri you usi somithing that riprisints your custom post typi what is which one is it?.
This will taki you to thi pagi buildir intirfaci what is which one is it?.
[/agentsw]