search
HomeCMS TutorialWordPressHow to Create a Custom Post Type Archive Page in WordPress

Do you want to create a custom post type archive page in WordPress?

Typically, custom post types in WordPress will use the theme's archive template. You can also create your own custom archive page for your post type.

In this article, we will show you how to easily create custom post type archive pages in WordPress.

How to Create a Custom Post Type Archive Page in WordPress

What is a custom post type archive page in WordPress?

The Custom Post Type Archive page is where users can view all items archived under a specific custom post type.

When you create a custom post type, WordPress automatically generates an archive page for that post type. An archive page is a list of all posts associated with that custom post type. This allows visitors to easily browse and access content in that particular post type.

By default, WordPress comes with two commonly used post types, called Posts and Pages. The WordPress plugin can also create its own post types.

For example, WooCommerce adds a new post type called "Product" to your WordPress site.

Similarly, you can create custom post types and use them to manage different types of content.

After you create a custom post type, you can use it within the WordPress admin area. However, your WordPress theme is responsible for displaying all your content.

If your theme does not have a template for a specific post type, WordPress will use the default archive template to display any post type archive page.

How to Create a Custom Post Type Archive Page in WordPress

To learn more, see a guide on WordPress template hierarchy and how to use them in WordPress themes.

Now, if you want to change how the custom post type archive page appears, you can do it by creating a custom template.

That being said, let's see how to easily create custom post type archive pages in WordPress.

Enable archive for your custom post type in WordPress

Before creating and using a custom post type archive page, first make sure that your custom post type has archive enabled.

For example, if your custom post type is called a movie and you have SEO-friendly permalink enabled, your post type archive will be marked as:

How to Create a Custom Post Type Archive Page in WordPress

Now, if you use a plugin to generate a custom post type, you can simply edit it there and enable the archive feature.

For example, in the CPT UI plug-in, you can edit custom post types and turn on the "Available" feature under Post Type settings.

How to Create a Custom Post Type Archive Page in WordPress

On the other hand, if you use code to generate a custom post type, you need to edit that code to enable archives.

Here is a short example of the code that generates the post type. You can see that the last line has an additional property to enable the archive page:

How to Create a Custom Post Type Archive Page in WordPress

From here, you need to download the archive.php file to your computer.

After downloading, you need to rename the file to archive-{posttype}.php, where {posttype} is the name of your custom post type.

For example, if your custom post type is called a movie, then you need to rename it to archive-movie.php.

How to Create a Custom Post Type Archive Page in WordPress

You can now open this file with any plain text editor (such as Notepad) for any changes.

This file already contains all the code needed to display the content of a custom post type. You can add any code you want to add or change the layout of an existing template.

Tip: If you need help, see our WordPress theme development cheat sheet for beginners.

Once you are satisfied with the 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 application.

You can now access the Custom Post Type Archive page to see the actual changes.

How to Create a Custom Post Type Archive Page in WordPress

Use SeedProd to create custom post type archive pages

For this method, we will use SeedProd. It is the best WordPress page builder plugin on the market, making it easy for you to create custom pages for your website.

It comes with a drag and drop interface, allowing you to easily design custom post type pages without writing any code. You can also use SeedProd to design other pages on your website and even create custom themes 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 WordPress plug-ins.

After activation, you need to enter the SeedProd license key. You can find this information in your account on the SeedProd website.

How to Create a Custom Post Type Archive Page in WordPress

Next, you need to go to SeedProd » Landing Pages .

From here, click the "Add New Landing Page" button to start.

How to Create a Custom Post Type Archive Page in WordPress

Next, you need to select a template for your page.

If there is a template similar to your website design, then you can use that template or start with a blank template.

How to Create a Custom Post Type Archive Page in WordPress

Next, you need to provide the page name and select the URL.

Make sure you use content that represents your custom post type.

How to Create a Custom Post Type Archive Page in WordPress

This will take you to the page builder interface.

You can select a layout to start and start adding blocks from the left column.

How to Create a Custom Post Type Archive Page in WordPress

We first add post blocks to display items in the custom post type.

Simply drag and drop the Posts block in the Advanced section onto your page.

How to Create a Custom Post Type Archive Page in WordPress

By default, the post block will display your blog post.

Click Block Settings and select your post type from the Query by Post Type section.

How to Create a Custom Post Type Archive Page in WordPress

After that, you can view additional options to open featured images, change excerpt size, and more.

Once you have finished setting up your post block, you can switch to the Sections tab and add a header or footer to the page layout.

How to Create a Custom Post Type Archive Page in WordPress

After you have finished editing, you can continue publishing the page.

Just click the drop-down arrow next to the Save button and select Publish.

How to Create a Custom Post Type Archive Page in WordPress

You can now access the custom page by clicking the Preview tab to see how it works.

Here is what our custom post type archive page looks like on our test site.

How to Create a Custom Post Type Archive Page in WordPress

You can also add this page to the navigation menu or continue editing to optimize it further.

Example of custom post type archive page

Custom templates for archive pages using post type allow you to customize them to suit your needs.

For example, you can delete the sidebar, change the page layout, and provide more context to make the archived page more attractive.

Here are some examples of custom post type archive pages with their own custom templates.

The WPBeginner transaction page is a custom post type that uses its own archive template.

How to Create a Custom Post Type Archive Page in WordPress

We also use custom templates for the WordPress glossary section.

This is also a custom post type.

How to Create a Custom Post Type Archive Page in WordPress

Our friends at MemberPress use custom post type archive templates in their plugin section.

You can see the example in the screenshot below.

How to Create a Custom Post Type Archive Page in WordPress

We hope this article helps you understand how to easily create custom post type archive pages. You may also want to check out our list of essential WordPress plugins and tools for our business website, or our expert comparison of the best commercial VoIP providers.

The above is the detailed content of How to Create a Custom Post Type Archive Page in WordPress. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How does WordPress's plugin ecosystem enhance its CMS capabilities?How does WordPress's plugin ecosystem enhance its CMS capabilities?May 14, 2025 am 12:20 AM

WordPresspluginssignificantlyenhanceitsCMScapabilitiesbyofferingcustomizationandfunctionality.1)Over50,000pluginsallowuserstotailortheirsiteforSEO,e-commerce,andsecurity.2)Pluginscanextendcorefeatures,likeaddingcustomposttypes.3)However,theycancausec

Is WordPress suitable for e-commerce?Is WordPress suitable for e-commerce?May 13, 2025 am 12:05 AM

Yes, WordPress is very suitable for e-commerce. 1) With the WooCommerce plugin, WordPress can quickly become a fully functional online store. 2) Pay attention to performance optimization and security, and regular updates and use of caches and security plug-ins are the key. 3) WordPress provides a wealth of customization options to improve user experience and significantly optimize SEO.

How to add your WordPress site in Yandex Webmaster ToolsHow to add your WordPress site in Yandex Webmaster ToolsMay 12, 2025 pm 09:06 PM

Do you want to connect your website to Yandex Webmaster Tools? Webmaster tools such as Google Search Console, Bing and Yandex can help you optimize your website, monitor traffic, manage robots.txt, check for website errors, and more. In this article, we will share how to add your WordPress website to the Yandex Webmaster Tool to monitor your search engine traffic. What is Yandex? Yandex is a popular search engine based in Russia, similar to Google and Bing. You can excel in Yandex

How to fix HTTP image upload errors in WordPress (simple)How to fix HTTP image upload errors in WordPress (simple)May 12, 2025 pm 09:03 PM

Do you need to fix HTTP image upload errors in WordPress? This error can be particularly frustrating when you create content in WordPress. This usually happens when you upload images or other files to your CMS using the built-in WordPress media library. In this article, we will show you how to easily fix HTTP image upload errors in WordPress. What is the reason for HTTP errors during WordPress media uploading? When you try to upload files to Wo using WordPress media uploader

How to fix the issue where adding media buttons don't work in WordPressHow to fix the issue where adding media buttons don't work in WordPressMay 12, 2025 pm 09:00 PM

Recently, one of our readers reported that the Add Media button on their WordPress site suddenly stopped working. This classic editor problem does not show any errors or warnings, which makes the user unaware why their "Add Media" button does not work. In this article, we will show you how to easily fix the Add Media button in WordPress that doesn't work. What causes WordPress "Add Media" button to stop working? If you are still using the old classic WordPress editor, the Add Media button allows you to insert images, videos, and more into your blog post.

How to set, get and delete WordPress cookies (like a professional)How to set, get and delete WordPress cookies (like a professional)May 12, 2025 pm 08:57 PM

Do you want to know how to use cookies on your WordPress website? Cookies are useful tools for storing temporary information in users’ browsers. You can use this information to enhance the user experience through personalization and behavioral targeting. In this ultimate guide, we will show you how to set, get, and delete WordPresscookies like a professional. Note: This is an advanced tutorial. It requires you to be proficient in HTML, CSS, WordPress websites and PHP. What are cookies? Cookies are created and stored when users visit websites.

How to Fix WordPress 429 Too Many Request ErrorsHow to Fix WordPress 429 Too Many Request ErrorsMay 12, 2025 pm 08:54 PM

Do you see the "429 too many requests" error on your WordPress website? This error message means that the user is sending too many HTTP requests to the server of your website. This error can be very frustrating because it is difficult to find out what causes the error. In this article, we will show you how to easily fix the "WordPress429TooManyRequests" error. What causes too many requests for WordPress429? The most common cause of the "429TooManyRequests" error is that the user, bot, or script attempts to go to the website

How scalable is WordPress as a CMS for large websites?How scalable is WordPress as a CMS for large websites?May 12, 2025 am 12:08 AM

WordPresscanhandlelargewebsiteswithcarefulplanningandoptimization.1)Usecachingtoreduceserverload.2)Optimizeyourdatabaseregularly.3)ImplementaCDNtodistributecontent.4)Vetpluginsandthemestoavoidconflicts.5)ConsidermanagedWordPresshostingforenhancedperf

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools